mirror of https://github.com/aseprite/aseprite.git
				
				
				
			Fix bug showing frame # and opacity slider in StatusBar without an active document
This commit is contained in:
		
							parent
							
								
									5a5a6fe4f6
								
							
						
					
					
						commit
						aae3e69fda
					
				|  | @ -137,6 +137,7 @@ StatusBar* StatusBar::m_instance = NULL; | ||||||
| StatusBar::StatusBar() | StatusBar::StatusBar() | ||||||
|   : Widget(statusbar_type()) |   : Widget(statusbar_type()) | ||||||
|   , m_color(app::Color::fromMask()) |   , m_color(app::Color::fromMask()) | ||||||
|  |   , m_hasDoc(false) | ||||||
| { | { | ||||||
|   m_instance = this; |   m_instance = this; | ||||||
| 
 | 
 | ||||||
|  | @ -331,7 +332,7 @@ void StatusBar::onResize(ResizeEvent& ev) | ||||||
|     rc.x += rc.w - prefWidth - border.right() - toolBarWidth; |     rc.x += rc.w - prefWidth - border.right() - toolBarWidth; | ||||||
|     rc.w = prefWidth; |     rc.w = prefWidth; | ||||||
| 
 | 
 | ||||||
|     m_commandsBox->setVisible(true); |     m_commandsBox->setVisible(true && m_hasDoc); | ||||||
|     m_commandsBox->setBounds(rc); |     m_commandsBox->setBounds(rc); | ||||||
|   } |   } | ||||||
|   else |   else | ||||||
|  | @ -455,6 +456,7 @@ void StatusBar::updateFromDocument(Editor* editor) | ||||||
|   try { |   try { | ||||||
|     if (editor && editor->document()) { |     if (editor && editor->document()) { | ||||||
|       const DocumentReader reader(editor->document(), 100); |       const DocumentReader reader(editor->document(), 100); | ||||||
|  |       m_hasDoc = true; | ||||||
|       m_commandsBox->setVisible(true); |       m_commandsBox->setVisible(true); | ||||||
| 
 | 
 | ||||||
|       // Cel opacity
 |       // Cel opacity
 | ||||||
|  | @ -473,11 +475,11 @@ void StatusBar::updateFromDocument(Editor* editor) | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|  |       m_hasDoc = false; | ||||||
|       m_commandsBox->setVisible(false); |       m_commandsBox->setVisible(false); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   catch (LockedDocumentException&) { |   catch (const LockedDocumentException&) { | ||||||
|     // Disable all
 |  | ||||||
|     m_slider->setEnabled(false); |     m_slider->setEnabled(false); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -83,6 +83,7 @@ namespace app { | ||||||
|     ui::Slider* m_slider;             // Opacity slider
 |     ui::Slider* m_slider;             // Opacity slider
 | ||||||
|     ui::Entry* m_currentFrame;        // Current frame and go to frame entry
 |     ui::Entry* m_currentFrame;        // Current frame and go to frame entry
 | ||||||
|     ui::Button* m_newFrame;           // Button to create a new frame
 |     ui::Button* m_newFrame;           // Button to create a new frame
 | ||||||
|  |     bool m_hasDoc; | ||||||
| 
 | 
 | ||||||
|     // Tip window
 |     // Tip window
 | ||||||
|     class CustomizedTipWindow; |     class CustomizedTipWindow; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue