[vlmc-devel] [PATCH] Notify toolbar about fullscreen mode change

Paweł Goliński golpaw1 at gmail.com
Fri Mar 11 15:04:13 CET 2016


Toolbar was not notified about user turning on/off
fullscreen mode without using toolbar button, which
caused it to show inconsistent state.
---
 src/Gui/MainWindow.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 609e710..ea977a3 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -176,6 +176,12 @@ MainWindow::changeEvent( QEvent *e )
         m_ui.retranslateUi( this );
         retranslateUi();
         break;
+    case QEvent::WindowStateChange:
+        if ( isFullScreen() )
+            m_ui.actionFullscreen->setChecked( true );
+        else
+            m_ui.actionFullscreen->setChecked( false );
+        break;
     default:
         break;
     }
-- 
2.5.4 (Apple Git-61)

> Wiadomość napisana przez Paweł Goliński <golpaw1 at gmail.com> w dniu 11.03.2016, o godz. 14:55:
> 
> Updated version of the patch:
> 
> <0001-Notify-toolbar-about-fullscreen-mode-change.patch>
> 
>> Wiadomość napisana przez Hugo Beauzée-Luyssen <hugo at beauzee.fr <mailto:hugo at beauzee.fr>> w dniu 11.03.2016, o godz. 11:25:
>> 
>> Hi,
>> 
>> All good, except for cosmetic issues:
>> 
>> On 03/11/2016 12:19 AM, Paweł Goliński wrote:
>>> Toolbar was not notified about user turning on/off
>>> fullscreen mode without using toolbar button, which
>>> caused it to show inconsistent state.
>>> ---
>>>  src/Gui/MainWindow.cpp | 9 ++++++++-
>>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
>>> index 609e710..c162cf9 100644
>>> --- a/src/Gui/MainWindow.cpp
>>> +++ b/src/Gui/MainWindow.cpp
>>> @@ -176,6 +176,13 @@ MainWindow::changeEvent( QEvent *e )
>>>          m_ui.retranslateUi( this );
>>>          retranslateUi();
>>>          break;
>>> +    case QEvent::WindowStateChange:
>>> +        if ( isFullScreen() ) {
>> 
>> Please either omit the curly braces, or put them on their own line, as per HACKING file
>> 
>>> +            m_ui.actionFullscreen->setChecked( true );
>>> +        } else {
>>> +            m_ui.actionFullscreen->setChecked( false );
>>> +        }
>>> +        break;
>>>      default:
>>>          break;
>>>      }
>>> @@ -496,7 +503,7 @@ MainWindow::initToolbar()
>>>      mouseActions->addAction( m_ui.actionCut_mode );
>>>      m_ui.actionSelection_mode->setChecked( true );
>>>      m_ui.toolBar->addActions( mouseActions->actions() );
>>> -    connect( mouseActions, SIGNAL( triggered(QAction*) ),
>>> +    connect( mouseActions, SIGNAL( triggered( QAction* ) ),
>>>               this, SLOT( toolButtonClicked( QAction* ) ) );
>> 
>> This change is unrelated, but would be welcome in a separate patch!
>> 
>>>      m_ui.menuTools->addActions( mouseActions->actions() );
>>>  }
>>> 
>> 
>> Regards,
>> _______________________________________________
>> Vlmc-devel mailing list
>> Vlmc-devel at videolan.org <mailto:Vlmc-devel at videolan.org>
>> https://mailman.videolan.org/listinfo/vlmc-devel <https://mailman.videolan.org/listinfo/vlmc-devel>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlmc-devel/attachments/20160311/f94841c9/attachment-0001.html>


More information about the Vlmc-devel mailing list