diff --git a/doc/Changelog.md b/doc/Changelog.md index 66b2850e..9428508e 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -2,8 +2,16 @@ Changelog {#changelog} ============ # Release 1.2 (git master) + +* [95](https://github.com/BlueBrain/Tide/pull/95): + More consistent and intuitive user experience: + - Double-tap a window to make it fullscreen + - To present multiple contents side by side, select them on the Desktop with a + single tap then press any of their "eye" icons. + - Tap the background to exit any presentation mode. + - On the Desktop, tap the background to unselect all windows. * [93](https://github.com/BlueBrain/Tide/pull/93): - Adding a whiteboard application [DISCL-137] : + Added a whiteboard application with support for: - Drawing in multiple colors and with different brush sizes - Saving an image to a png file - Extending/shrinking a canvas on the size change of applications window diff --git a/tests/cpp/core/DisplayGroupTests.cpp b/tests/cpp/core/DisplayGroupTests.cpp index 543a8bd2..413cfe95 100644 --- a/tests/cpp/core/DisplayGroupTests.cpp +++ b/tests/cpp/core/DisplayGroupTests.cpp @@ -104,12 +104,12 @@ BOOST_AUTO_TEST_CASE( testWindowZorder ) BOOST_CHECK_EQUAL( group->getZindex( window2 ), 2 ); - group->moveContentWindowToFront( window1 ); + group->moveToFront( window1 ); BOOST_CHECK_EQUAL( group->getZindex( window0 ), 0 ); BOOST_CHECK_EQUAL( group->getZindex( window2 ), 1 ); BOOST_CHECK_EQUAL( group->getZindex( window1 ), 2 ); - group->moveContentWindowToFront( window0 ); + group->moveToFront( window0 ); BOOST_CHECK_EQUAL( group->getZindex( window2 ), 0 ); BOOST_CHECK_EQUAL( group->getZindex( window1 ), 1 ); BOOST_CHECK_EQUAL( group->getZindex( window0 ), 2 ); diff --git a/tests/cpp/core/VisibilityHelperTests.cpp b/tests/cpp/core/VisibilityHelperTests.cpp index 45426329..4305e817 100644 --- a/tests/cpp/core/VisibilityHelperTests.cpp +++ b/tests/cpp/core/VisibilityHelperTests.cpp @@ -163,7 +163,7 @@ BOOST_FIXTURE_TEST_CASE( testUnderlyingWindow, Fixture ) BOOST_CHECK_EQUAL( helper.getVisibleArea( *window ), QRectF( )); BOOST_CHECK_EQUAL( helper.getVisibleArea( *otherWindow ), coord ); - group->moveContentWindowToFront( window ); + group->moveToFront( window ); BOOST_CHECK_EQUAL( helper.getVisibleArea( *otherWindow ), QRectF( )); BOOST_CHECK_EQUAL( helper.getVisibleArea( *window ), coord ); } diff --git a/tide/core/resources/BaseContentWindow.qml b/tide/core/resources/BaseContentWindow.qml index d4b68db2..2f549422 100644 --- a/tide/core/resources/BaseContentWindow.qml +++ b/tide/core/resources/BaseContentWindow.qml @@ -31,7 +31,7 @@ Rectangle { y: contentArea.posY - yOffset width: contentArea.width + border.width * 2 height: contentArea.height + border.width + yOffset // top + bottom padding - z: isBackground ? Style.backgroundZOrder : 0 + z: isBackground ? Style.backgroundZOrder : contentwindow.isPanel ? Style.panelsZorder : 0 Loader { id: backgroundLoader @@ -166,7 +166,7 @@ Rectangle { delegate: Triangle { } delegateOverflow: windowRect.border.width - visible: (contentwindow.controlsVisible || contentwindow.focused || + visible: (contentwindow.selected || contentwindow.focused || contentwindow.fullscreen) && contentwindow.content.page !== undefined && contentwindow.content.page > 0 @@ -181,7 +181,7 @@ Rectangle { } delegateOverflow: windowRect.border.width flipRight: true - visible: (contentwindow.controlsVisible || contentwindow.focused || + visible: (contentwindow.selected || contentwindow.focused || contentwindow.fullscreen) && contentwindow.content.page !== undefined && contentwindow.content.page < contentwindow.content.pageCount - 1 @@ -190,6 +190,7 @@ Rectangle { WindowControls { id: windowControls contentActionsVisible: !controlBar.visible + color: windowRect.border.color } ResizeCircles { @@ -233,6 +234,14 @@ Rectangle { z: Style.focusZorder } }, + State { + name: "selected" + when: contentwindow.selected + PropertyChanges { + target: windowRect + border.color: Style.windowBorderSelectedColor + } + }, State { name: "moving" when: contentwindow.state === ContentWindow.MOVING @@ -269,7 +278,7 @@ Rectangle { transitions: [ Transition { from: "focused" - to: "" + to: "selected," // selected AND default state "" id: unfocusTransition SequentialAnimation { // Slide behind other focused windows for the transition diff --git a/tide/core/resources/DisplayGroup.qml b/tide/core/resources/DisplayGroup.qml index 635ed76e..3eebdd5c 100644 --- a/tide/core/resources/DisplayGroup.qml +++ b/tide/core/resources/DisplayGroup.qml @@ -6,6 +6,7 @@ Item { id: displaygroupitem property alias showFocusContext: focuscontext.visible + property alias focusContextZorder: focuscontext.z property alias sideControl: sideControl width: displaygroup.width @@ -52,6 +53,15 @@ Item { target: focuscontext opacity: Style.focusContextOpacity } + }, + State { + name: "panels" + when: displaygroup.hasVisiblePanels + PropertyChanges { + target: focuscontext + opacity: Style.focusContextPanelsOpacity + z: Style.panelsBackgroundZorder + } } ] } diff --git a/tide/core/resources/ResizeCircles.qml b/tide/core/resources/ResizeCircles.qml index 56096971..002a1949 100644 --- a/tide/core/resources/ResizeCircles.qml +++ b/tide/core/resources/ResizeCircles.qml @@ -9,7 +9,7 @@ Rectangle { property alias delegate: repeater.delegate visible: !contentwindow.isPanel - && contentwindow.controlsVisible + && contentwindow.selected && contentwindow.mode === ContentWindow.STANDARD opacity: Style.resizeCircleOpacity diff --git a/tide/core/resources/SideControl.qml b/tide/core/resources/SideControl.qml index a5718093..8966b595 100644 --- a/tide/core/resources/SideControl.qml +++ b/tide/core/resources/SideControl.qml @@ -15,8 +15,8 @@ SideButton { anchors.fill: parent anchors.margins: sideControl.innerMargin * parent.width Image { - source: displaygroup.hasFullscreenWindows ? "qrc:/img/exit.svg" : - displaygroup.hasFocusedWindows ? "qrc:/img/focus.svg" : + source: displaygroup.hasFullscreenWindows || + displaygroup.hasFocusedWindows ? "qrc:/img/exit.svg" : "qrc:/img/launch.svg" width: parent.width height: width diff --git a/tide/core/resources/WindowControls.qml b/tide/core/resources/WindowControls.qml index 6a8b1ddd..e7f2adb8 100644 --- a/tide/core/resources/WindowControls.qml +++ b/tide/core/resources/WindowControls.qml @@ -10,7 +10,7 @@ Rectangle { width: buttons.width + radius + (Style.buttonsSize * (1.0 - Style.buttonsImageRelSize)) height: buttons.height + (Style.buttonsSize * (1.0 - Style.buttonsImageRelSize)) color: Style.controlsDefaultColor - border.color: Style.controlsDefaultColor + border.color: color border.width: Style.controlsBorderWidth radius: Style.controlsRadius anchors.right: parent.left @@ -52,11 +52,6 @@ Rectangle { name: "focus_mode" when: contentwindow.focused extend: "opaque" - PropertyChanges { - target: windowControls - color: Style.controlsFocusedColor - border.color: Style.controlsFocusedColor - } PropertyChanges { target: buttons fixed_buttons_count: 3 @@ -64,7 +59,7 @@ Rectangle { }, State { name: "opaque" - when: contentwindow.controlsVisible && + when: contentwindow.selected && contentwindow.state !== ContentWindow.RESIZING && !contentwindow.fullscreen PropertyChanges { @@ -82,8 +77,6 @@ Rectangle { duration: Style.focusTransitionTime easing.type: Easing.InOutQuad } - ColorAnimation { duration: Style.focusTransitionTime } - ColorAnimation { target: border; duration: Style.focusTransitionTime } } ] } diff --git a/tide/core/resources/style.js b/tide/core/resources/style.js index 7b1b6c58..95c87033 100644 --- a/tide/core/resources/style.js +++ b/tide/core/resources/style.js @@ -8,6 +8,8 @@ var contrastColor = "black"; // black // General var backgroundZOrder = -1; +var panelsBackgroundZorder = 96; +var panelsZorder = 97; var focusBackgroundZorder = 98; var unfocusZorder = 99; var focusZorder = 100; @@ -18,6 +20,7 @@ var overlayZorder = 1000; var focusContextColor = "black" var focusContextOpacity = 0.7; +var focusContextPanelsOpacity = 0.5; var focusContextFullscreenOpacity = 0.99; var focusTransitionTime = 500; var panelsAnimationTime = 300 @@ -64,7 +67,7 @@ var transparentContentsBackgroundColor = "black"; var windowBorderWidth = 24; var windowBorderDefaultColor = baseColor; -var windowBorderSelectedColor = baseColor; +var windowBorderSelectedColor = activeColor; var windowBorderFocusedColor = activeColor; var windowBorderMovingColor = baseColor; var windowBorderResizingColor = baseColor; diff --git a/tide/core/scene/ContentWindow.cpp b/tide/core/scene/ContentWindow.cpp index 013b23d0..a97214e1 100644 --- a/tide/core/scene/ContentWindow.cpp +++ b/tide/core/scene/ContentWindow.cpp @@ -51,7 +51,7 @@ ContentWindow::ContentWindow( ContentPtr content, const WindowType type ) , _resizePolicy( KEEP_ASPECT_RATIO ) , _mode( WindowMode::STANDARD ) , _windowState( NONE ) - , _controlsVisible( false ) + , _selected( false ) { assert( content ); _init(); @@ -65,7 +65,7 @@ ContentWindow::ContentWindow() , _resizePolicy( KEEP_ASPECT_RATIO ) , _mode( WindowMode::STANDARD ) , _windowState( NONE ) - , _controlsVisible( false ) + , _selected( false ) {} ContentWindow::~ContentWindow() {} @@ -284,18 +284,18 @@ QString ContentWindow::getLabel() const return _content->getURI().section( "/", -1, -1 ); } -bool ContentWindow::getControlsVisible() const +bool ContentWindow::isSelected() const { - return _controlsVisible; + return _selected; } -void ContentWindow::setControlsVisible( const bool value ) +void ContentWindow::setSelected( const bool value ) { - if( value == _controlsVisible ) + if( value == _selected ) return; - _controlsVisible = value; - emit controlsVisibleChanged(); + _selected = value; + emit selectedChanged(); emit modified(); } diff --git a/tide/core/scene/ContentWindow.h b/tide/core/scene/ContentWindow.h index 22ecb9eb..6e936298 100644 --- a/tide/core/scene/ContentWindow.h +++ b/tide/core/scene/ContentWindow.h @@ -75,8 +75,8 @@ class ContentWindow : public Rectangle Q_PROPERTY( ResizePolicy resizePolicy READ getResizePolicy WRITE setResizePolicy NOTIFY resizePolicyChanged ) Q_PROPERTY( QString label READ getLabel NOTIFY labelChanged ) - Q_PROPERTY( bool controlsVisible READ getControlsVisible - WRITE setControlsVisible NOTIFY controlsVisibleChanged ) + Q_PROPERTY( bool selected READ isSelected + WRITE setSelected NOTIFY selectedChanged ) public: /** The current active resize handle. */ @@ -125,7 +125,8 @@ class ContentWindow : public Rectangle enum WindowType { DEFAULT, // A regular window - PANEL // A panel window - always interative, cannot be focused + PANEL // An overlay window without a control bar, cannot be + // focused or fullscreen }; Q_ENUMS( WindowType ) @@ -144,7 +145,7 @@ class ContentWindow : public Rectangle /** @return the unique identifier for this window. */ const QUuid& getID() const; - /** Is the window a panel */ + /** @return true if window is a panel. */ bool isPanel() const; /** Get the content from QML. */ @@ -215,11 +216,11 @@ class ContentWindow : public Rectangle /** Get the label for the window */ QString getLabel() const; - /** Get the visibility of the window control buttons. */ - bool getControlsVisible() const; + /** @return true if the window is selected. */ + bool isSelected() const; - /** Set the visibility of the window control buttons. */ - void setControlsVisible( bool value ); + /** Select or deselect the window. */ + void setSelected( bool value ); public slots: /** Set the current active resize handle. */ @@ -253,7 +254,7 @@ public slots: void fullscreenCoordinatesChanged(); void stateChanged(); void labelChanged(); - void controlsVisibleChanged(); + void selectedChanged(); void hiddenChanged( bool hidden ); //@} @@ -277,7 +278,7 @@ public slots: ar & _focusedCoordinates; ar & _fullscreenCoordinates; ar & _windowState; - ar & _controlsVisible; + ar & _selected; } /** Serialize members to and from xml. */ @@ -347,7 +348,7 @@ public slots: QRectF _focusedCoordinates; QRectF _fullscreenCoordinates; ContentWindow::WindowState _windowState; - bool _controlsVisible; + bool _selected; }; BOOST_CLASS_VERSION( ContentWindow, 3 ) diff --git a/tide/core/scene/DisplayGroup.cpp b/tide/core/scene/DisplayGroup.cpp index 43a2c4c7..59d48ea2 100644 --- a/tide/core/scene/DisplayGroup.cpp +++ b/tide/core/scene/DisplayGroup.cpp @@ -55,21 +55,27 @@ DisplayGroup::DisplayGroup( const QSizeF& size_ ) DisplayGroup::~DisplayGroup() {} -void DisplayGroup::addContentWindow( ContentWindowPtr contentWindow ) +void DisplayGroup::addContentWindow( ContentWindowPtr window ) { for( ContentWindowPtr existingWindow : _contentWindows ) { - if( contentWindow->getID() == existingWindow->getID( )) + if( window->getID() == existingWindow->getID( )) { put_flog( LOG_DEBUG, "A window with the same id already exists!" ); return; } } - _contentWindows.push_back( contentWindow ); - _watchChanges( contentWindow ); + _contentWindows.push_back( window ); + _watchChanges( *window ); - emit( contentWindowAdded( contentWindow )); + if( window->isPanel( )) + { + _panels.insert( window ); + emit hasVisiblePanelsChanged(); + } + + emit( contentWindowAdded( window )); _sendDisplayGroup(); } @@ -82,6 +88,12 @@ void DisplayGroup::removeContentWindow( ContentWindowPtr window ) if( *it == _fullscreenWindow ) setFullscreenWindow( ContentWindowPtr( )); + if( window->isPanel( )) + { + _panels.erase( window ); + emit hasVisiblePanelsChanged(); + } + removeFocusedWindow( *it ); _contentWindows.erase( it ); @@ -92,7 +104,7 @@ void DisplayGroup::removeContentWindow( ContentWindowPtr window ) _sendDisplayGroup(); } -void DisplayGroup::moveContentWindowToFront( ContentWindowPtr window ) +void DisplayGroup::moveToFront( ContentWindowPtr window ) { if( !window || window == _contentWindows.back( )) return; @@ -129,16 +141,23 @@ ContentWindowPtr DisplayGroup::getContentWindow( const QUuid& id ) const return ContentWindowPtr(); } -void DisplayGroup::setContentWindows( ContentWindowPtrs contentWindows ) +void DisplayGroup::setContentWindows( ContentWindowPtrs windows ) { clear(); - for( ContentWindowPtr window : contentWindows ) + for( const auto& window : windows ) { addContentWindow( window ); if( window->isFocused( )) _focusedWindows.insert( window ); + if( window->isPanel( )) + _panels.insert( window ); } + if( !_focusedWindows.empty( )) + emit hasFocusedWindowsChanged(); + if( !_panels.empty( )) + emit hasVisiblePanelsChanged(); + _sendDisplayGroup(); } @@ -188,6 +207,14 @@ bool DisplayGroup::hasFullscreenWindows() const return static_cast( _fullscreenWindow ); } +bool DisplayGroup::hasVisiblePanels() const +{ + for( const auto& window : _panels ) + if( !window->isHidden( )) + return true; + return false; +} + const ContentWindowSet& DisplayGroup::getFocusedWindows() const { return _focusedWindows; @@ -219,6 +246,11 @@ void DisplayGroup::removeFocusedWindow( ContentWindowPtr window ) _sendDisplayGroup(); } +const ContentWindowSet& DisplayGroup::getPanels() const +{ + return _panels; +} + #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" #pragma clang diagnostic push @@ -280,11 +312,15 @@ void DisplayGroup::_sendDisplayGroup() emit modified( shared_from_this( )); } -void DisplayGroup::_watchChanges( ContentWindowPtr contentWindow ) +void DisplayGroup::_watchChanges( ContentWindow& window ) { - connect( contentWindow.get(), &ContentWindow::modified, + connect( &window, &ContentWindow::modified, this, &DisplayGroup::_sendDisplayGroup ); - connect( contentWindow.get(), &ContentWindow::contentModified, + connect( &window, &ContentWindow::contentModified, this, &DisplayGroup::_sendDisplayGroup ); + + if( window.isPanel( )) + connect( &window, &ContentWindow::hiddenChanged, + this, &DisplayGroup::hasVisiblePanelsChanged ); } diff --git a/tide/core/scene/DisplayGroup.h b/tide/core/scene/DisplayGroup.h index e4a42763..f7d3f802 100644 --- a/tide/core/scene/DisplayGroup.h +++ b/tide/core/scene/DisplayGroup.h @@ -77,6 +77,8 @@ class DisplayGroup : public Rectangle, NOTIFY hasFullscreenWindowsChanged ) Q_PROPERTY( ContentWindow* fullscreenWindow READ getFullscreenWindow NOTIFY hasFullscreenWindowsChanged ) + Q_PROPERTY( bool hasVisiblePanels READ hasVisiblePanels + NOTIFY hasVisiblePanelsChanged ) public: /** Constructor */ @@ -86,13 +88,13 @@ class DisplayGroup : public Rectangle, virtual ~DisplayGroup(); /** Add a content window. */ - void addContentWindow( ContentWindowPtr contentWindow ); + void addContentWindow( ContentWindowPtr window ); /** Remove a content window. */ - Q_INVOKABLE void removeContentWindow( ContentWindowPtr contentWindow ); + Q_INVOKABLE void removeContentWindow( ContentWindowPtr window ); /** Move a content window to the front. */ - void moveContentWindowToFront( ContentWindowPtr contentWindow ); + void moveToFront( ContentWindowPtr window ); /** * Is the DisplayGroup empty. @@ -108,9 +110,9 @@ class DisplayGroup : public Rectangle, /** * Replace the content windows. - * @param contentWindows The list of windows to set. + * @param windows the list of windows to set. */ - void setContentWindows( ContentWindowPtrs contentWindows ); + void setContentWindows( ContentWindowPtrs windows ); /** Clear all ContentWindows. */ void clear(); @@ -129,6 +131,9 @@ class DisplayGroup : public Rectangle, /** Is there a fullscreen window. */ bool hasFullscreenWindows() const; + /** Is there any visible panel window(s). */ + bool hasVisiblePanels() const; + /** Get the fullscreen window (if any). */ ContentWindow* getFullscreenWindow() const; @@ -146,6 +151,10 @@ class DisplayGroup : public Rectangle, /** Remove a window from the set of focused windows. */ void removeFocusedWindow( ContentWindowPtr window ); + + /** Get the set of panels. */ + const ContentWindowSet& getPanels() const; + /** * Move this object and its member QObjects to the given QThread. * @@ -185,6 +194,9 @@ class DisplayGroup : public Rectangle, /** Notifier for the hasFullscreenWindows property. */ void hasFullscreenWindowsChanged(); + + /** Notifier for the hasVisiblePanels property. */ + void hasVisiblePanelsChanged(); //@} private: @@ -200,6 +212,7 @@ class DisplayGroup : public Rectangle, ar & _contentWindows; ar & _focusedWindows; ar & _fullscreenWindow; + ar & _panels; } /** Serialize for saving to an xml file */ @@ -218,10 +231,12 @@ class DisplayGroup : public Rectangle, const unsigned int version) { serialize_members_xml( ar, version ); - for( ContentWindowPtr window : _contentWindows ) + for( const auto& window : _contentWindows ) { if( window->isFocused( )) _focusedWindows.insert( window ); + if( window->isPanel( )) + _panels.insert( window ); // Make sure windows are not in an undefined state window->setState( ContentWindow::NONE ); } @@ -235,12 +250,13 @@ class DisplayGroup : public Rectangle, } void _sendDisplayGroup(); - void _watchChanges( ContentWindowPtr contentWindow ); + void _watchChanges( ContentWindow& window ); bool _showWindowTitlesInSavedSession = true; ContentWindowPtrs _contentWindows; ContentWindowSet _focusedWindows; ContentWindowPtr _fullscreenWindow; + ContentWindowSet _panels; ContentWindow::WindowMode _fullscreenWindowPrevMode = ContentWindow::WindowMode::STANDARD; diff --git a/tide/core/scene/Options.h b/tide/core/scene/Options.h index 8df74ecb..5db39206 100644 --- a/tide/core/scene/Options.h +++ b/tide/core/scene/Options.h @@ -63,7 +63,8 @@ class Options : public QObject, public boost::enable_shared_from_this Q_DISABLE_COPY( Options ) Q_PROPERTY( bool alphaBlending READ isAlphaBlendingEnabled NOTIFY alphaBlendingEnabledChanged ) - Q_PROPERTY( bool showClock READ getShowClock NOTIFY showClockChanged ) + Q_PROPERTY( bool showClock READ getShowClock WRITE setShowClock + NOTIFY showClockChanged ) Q_PROPERTY( bool showContentTiles READ getShowContentTiles NOTIFY showContentTilesChanged ) Q_PROPERTY( bool showControlArea READ getShowControlArea @@ -75,7 +76,7 @@ class Options : public QObject, public boost::enable_shared_from_this Q_PROPERTY( bool showWindowBorders READ getShowWindowBorders NOTIFY showWindowBordersChanged ) Q_PROPERTY( bool showWindowTitles READ getShowWindowTitles - WRITE setShowWindowTitles NOTIFY showWindowTitlesChanged ) + NOTIFY showWindowTitlesChanged ) Q_PROPERTY( bool showZoomContext READ getShowZoomContext NOTIFY showZoomContextChanged ) diff --git a/tide/master/ContentLoader.cpp b/tide/master/ContentLoader.cpp index 00b9fe4c..1b19476e 100644 --- a/tide/master/ContentLoader.cpp +++ b/tide/master/ContentLoader.cpp @@ -91,10 +91,20 @@ bool ContentLoader::load( const QString& filename, bool ContentLoader::isAlreadyOpen( const QString& filename ) const { - for( const ContentWindowPtr& window : _displayGroup->getContentWindows( )) + for( const auto& window : _displayGroup->getContentWindows( )) { if( window->getContent()->getURI() == filename ) return true; } return false; } + +ContentWindowPtr ContentLoader::findWindow( const QString& filename ) const +{ + for( const auto& window : _displayGroup->getContentWindows( )) + { + if( window->getContent()->getURI() == filename ) + return window; + } + return {}; +} diff --git a/tide/master/ContentLoader.h b/tide/master/ContentLoader.h index ca79626c..40b3f788 100644 --- a/tide/master/ContentLoader.h +++ b/tide/master/ContentLoader.h @@ -82,6 +82,14 @@ class ContentLoader */ bool isAlreadyOpen( const QString& filename ) const; + /** + * Find an open window by its filename. + * + * @param filename The content file to search for. + * @return the window corresponding to the file if it is open or nullptr. + */ + ContentWindowPtr findWindow( const QString& filename ) const; + private: DisplayGroupPtr _displayGroup; }; diff --git a/tide/master/MasterApplication.cpp b/tide/master/MasterApplication.cpp index b08fd792..f2749d63 100644 --- a/tide/master/MasterApplication.cpp +++ b/tide/master/MasterApplication.cpp @@ -85,6 +85,7 @@ MasterApplication::MasterApplication( int& argc_, char** argv_, , _masterToForkerChannel( new MasterToForkerChannel( forkChannel )) , _masterToWallChannel( new MasterToWallChannel( worldChannel )) , _masterFromWallChannel( new MasterFromWallChannel( worldChannel )) + , _options( new Options ) , _markers( new Markers ) { master::registerQmlTypes(); @@ -132,7 +133,7 @@ void MasterApplication::_init() { _displayGroup.reset( new DisplayGroup( _config->getTotalSize( ))); - _masterWindow.reset( new MasterWindow( _displayGroup, *_config )); + _masterWindow.reset( new MasterWindow( _displayGroup, _options, *_config )); _pixelStreamWindowManager.reset( new PixelStreamWindowManager( *_displayGroup )); @@ -145,8 +146,7 @@ void MasterApplication::_init() _displayGroup->setContentWindows( group->getContentWindows( )); _displayGroup->setShowWindowTitles( group->getShowWindowTitles( )); - _masterWindow->getOptions()->setShowWindowTitles( - group->getShowWindowTitles( )); + _options->setShowWindowTitles( group->getShowWindowTitles( )); }); _initPixelStreamLauncher(); @@ -213,8 +213,7 @@ void MasterApplication::_startDeflectServer() void MasterApplication::_restoreBackground() { - OptionsPtr options = _masterWindow->getOptions(); - options->setBackgroundColor( _config->getBackgroundColor( )); + _options->setBackgroundColor( _config->getBackgroundColor( )); const QString& uri = _config->getBackgroundUri(); if( !uri.isEmpty( )) @@ -222,7 +221,7 @@ void MasterApplication::_restoreBackground() ContentPtr content = ContentFactory::getContent( uri ); if( !content ) content = ContentFactory::getErrorContent(); - options->setBackgroundContent( content ); + _options->setBackgroundContent( content ); } } @@ -235,10 +234,13 @@ void MasterApplication::_initPixelStreamLauncher() &MasterWindow::openWebBrowser, _pixelStreamerLauncher.get(), &PixelStreamerLauncher::openWebBrowser ); - connect( _masterWindow.get(), &MasterWindow::openLauncher, + + connect( _masterWindow->getDisplayGroupView(), + &DisplayGroupView::openLauncher, _pixelStreamerLauncher.get(), &PixelStreamerLauncher::openLauncher ); - connect( _masterWindow.get(), &MasterWindow::hideLauncher, + connect( _masterWindow->getDisplayGroupView(), + &DisplayGroupView::hideLauncher, _pixelStreamerLauncher.get(), &PixelStreamerLauncher::hideLauncher ); } @@ -258,7 +260,7 @@ void MasterApplication::_initMPIConnection() { _masterToWallChannel->sendAsync( displayGroup ); }, Qt::DirectConnection ); - connect( _masterWindow->getOptions().get(), &Options::updated, + connect( _options.get(), &Options::updated, _masterToWallChannel.get(), [this]( OptionsPtr options ) { _masterToWallChannel->sendAsync( options ); }, @@ -302,8 +304,8 @@ void MasterApplication::_initMPIConnection() &deflect::FrameDispatcher::requestFrame ); _pixelStreamWindowManager->setAutoFocusNewWindows( - _masterWindow->getOptions()->getAutoFocusPixelStreams( )); - connect( _masterWindow->getOptions().get(), + _options->getAutoFocusPixelStreams( )); + connect( _options.get(), &Options::autoFocusPixelStreamsChanged, _pixelStreamWindowManager.get(), &PixelStreamWindowManager::setAutoFocusNewWindows ); @@ -380,7 +382,7 @@ void MasterApplication::_initTouchListener() void MasterApplication::_initRestInterface() { _restInterface = make_unique( _config->getWebServicePort(), - _masterWindow->getOptions( )); + _options ); _logger = make_unique(); connect( _restInterface.get(), &RestInterface::browse, [this]( QString uri ) @@ -403,7 +405,12 @@ void MasterApplication::_initRestInterface() connect( _restInterface.get(), &RestInterface::open, [this]( QString uri ) { - ContentLoader( _displayGroup ).load( uri ); + auto loader = ContentLoader{ _displayGroup }; + auto window = loader.findWindow( uri ); + if( window ) + _displayGroup->moveToFront( window ); + else + loader.load( uri ); }); connect( _restInterface.get(), &RestInterface::load, [this]( QString uri ) { @@ -412,8 +419,7 @@ void MasterApplication::_initRestInterface() }); connect( _restInterface.get(), &RestInterface::save, [this]( QString uri ) { - _displayGroup->setShowWindowTitles( - _masterWindow->getOptions()->getShowWindowTitles( )); + _displayGroup->setShowWindowTitles( _options->getShowWindowTitles( )); _saveSessionOp.setFuture( StateSerializationHelper( _displayGroup ).save( uri )); }); diff --git a/tide/master/MasterApplication.h b/tide/master/MasterApplication.h index 99096b5d..e3a417f9 100644 --- a/tide/master/MasterApplication.h +++ b/tide/master/MasterApplication.h @@ -105,6 +105,7 @@ class MasterApplication : public QApplication QFutureWatcher _saveSessionOp; DisplayGroupPtr _displayGroup; + OptionsPtr _options; MarkersPtr _markers; QThread _mpiSendThread; diff --git a/tide/master/PixelStreamWindowManager.cpp b/tide/master/PixelStreamWindowManager.cpp index c6c27135..d7a753b8 100644 --- a/tide/master/PixelStreamWindowManager.cpp +++ b/tide/master/PixelStreamWindowManager.cpp @@ -90,7 +90,7 @@ void PixelStreamWindowManager::showWindow( const QString& uri ) return; window->setState( ContentWindow::NONE ); - _displayGroup.moveContentWindowToFront( window ); + _displayGroup.moveToFront( window ); } void PixelStreamWindowManager::openWindow( const QString& uri, diff --git a/tide/master/StateSerializationHelper.h b/tide/master/StateSerializationHelper.h index 1d72d221..4dbf335b 100644 --- a/tide/master/StateSerializationHelper.h +++ b/tide/master/StateSerializationHelper.h @@ -76,7 +76,6 @@ class StateSerializationHelper private: DisplayGroupPtr _displayGroup; - DisplayGroupPtr _copyDisplayGroup() const; }; #endif diff --git a/tide/master/control/DisplayGroupController.cpp b/tide/master/control/DisplayGroupController.cpp index 7aa33220..7a9acb3b 100644 --- a/tide/master/control/DisplayGroupController.cpp +++ b/tide/master/control/DisplayGroupController.cpp @@ -96,7 +96,14 @@ void DisplayGroupController::showFullscreen( const QUuid& id ) void DisplayGroupController::exitFullscreen() { + auto window = _group.getFullscreenWindow(); + if( !window ) + return; + _group.setFullscreenWindow( ContentWindowPtr( )); + + if( !window->isFocused( )) + window->setSelected( false ); } void DisplayGroupController::focus( const QUuid& id ) @@ -120,21 +127,56 @@ void DisplayGroupController::unfocus( const QUuid& id ) return; _group.removeFocusedWindow( window ); + _readjustToNewZoomLevel( *window ); + window->setSelected( false ); + updateFocusedWindowsCoordinates(); +} - // Make sure the window dimensions are re-adjusted to the new zoom level - ContentWindowController{ *window, _group }.scale( window->center(), 0.0 ); +void DisplayGroupController::focusSelected() +{ + unfocusAll(); // ensure precondition, but should already be empty + + auto focusedWindows = ContentWindowSet{}; + + for( const auto& window : _group.getContentWindows( )) + if( window->isSelected( )) + focusedWindows.insert( window ); + + // Update focused coordinates BEFORE adding windows for proper transition + LayoutEngine{ _group }.updateFocusedCoord( focusedWindows ); + for( const auto& window : focusedWindows ) + _group.addFocusedWindow( window ); } void DisplayGroupController::unfocusAll() { - while( !_group.getFocusedWindows().empty( )) - unfocus( (*_group.getFocusedWindows().begin( ))->getID( )); + const auto focusedWindows = _group.getFocusedWindows(); + + for( const auto& window : focusedWindows ) + { + _group.removeFocusedWindow( window ); + _readjustToNewZoomLevel( *window ); + } + + updateFocusedWindowsCoordinates(); +} + +void DisplayGroupController::deselectAll() +{ + for( const auto& window : _group.getContentWindows( )) + window->setSelected( false ); +} + +void DisplayGroupController::hidePanels() +{ + for( const auto& panel : _group.getPanels( )) + panel->setState( ContentWindow::HIDDEN ); } void DisplayGroupController::moveWindowToFront( const QUuid id ) { - _group.moveContentWindowToFront( _group.getContentWindow( id )); + _group.moveToFront( _group.getContentWindow( id )); } void DisplayGroupController::scale( const QSizeF& factor ) @@ -225,3 +267,8 @@ qreal DisplayGroupController::_estimateAspectRatio() const averageAR /= _group.getContentWindows().size(); return averageAR; } + +void DisplayGroupController::_readjustToNewZoomLevel( ContentWindow& window ) +{ + ContentWindowController{ window, _group }.scale( window.center(), 0.0 ); +} diff --git a/tide/master/control/DisplayGroupController.h b/tide/master/control/DisplayGroupController.h index b2eee1db..5bb04fee 100644 --- a/tide/master/control/DisplayGroupController.h +++ b/tide/master/control/DisplayGroupController.h @@ -78,9 +78,18 @@ class DisplayGroupController : public QObject /** Unfocus a window. */ Q_INVOKABLE void unfocus( const QUuid& id ); + /** Focus all selected windows. */ + Q_INVOKABLE void focusSelected(); + /** Unfocus all focused windows. */ Q_INVOKABLE void unfocusAll(); + /** Deselect all selected windows. */ + Q_INVOKABLE void deselectAll(); + + /** Hide all panels. */ + Q_INVOKABLE void hidePanels(); + /** Move a content window to the front. */ Q_INVOKABLE void moveWindowToFront( QUuid id ); @@ -112,6 +121,7 @@ class DisplayGroupController : public QObject void _extend( const QSizeF& newSize ); qreal _estimateAspectRatio() const; + void _readjustToNewZoomLevel( ContentWindow& window ); }; #endif diff --git a/tide/master/localstreamer/PixelStreamerLauncher.cpp b/tide/master/localstreamer/PixelStreamerLauncher.cpp index e33f85a5..a488b2ec 100644 --- a/tide/master/localstreamer/PixelStreamerLauncher.cpp +++ b/tide/master/localstreamer/PixelStreamerLauncher.cpp @@ -84,10 +84,11 @@ void PixelStreamerLauncher::openWebBrowser( QPointF pos, const QSize size, const QString& uri = QString( "WebBrowser_%1" ).arg( webbrowserCounter++ ); const QSize viewportSize = !size.isEmpty() ? size : WEBBROWSER_DEFAULT_SIZE; - if ( pos.isNull() ) - pos = _getDefaultWindowPosition(); + if( pos.isNull( )) + pos = _getDefaultWindowPosition(); - _windowManager.openWindow( uri, pos, viewportSize, PixelStreamWindowManager::WEBBROWSER ); + _windowManager.openWindow( uri, pos, viewportSize, + PixelStreamWindowManager::WEBBROWSER ); CommandLineOptions options; #ifdef TIDE_USE_QT5WEBKITWIDGETS diff --git a/tide/master/resources/MasterContentWindow.qml b/tide/master/resources/MasterContentWindow.qml index d1a02019..83c4a494 100644 --- a/tide/master/resources/MasterContentWindow.qml +++ b/tide/master/resources/MasterContentWindow.qml @@ -18,10 +18,10 @@ BaseContentWindow { groupcontroller.removeWindowLater(contentwindow.id) } - function toggleControlsVisibility() { + function toggleSelected() { if(contentwindow.isPanel) return - contentwindow.controlsVisible = !contentwindow.controlsVisible + contentwindow.selected = !contentwindow.selected } function toggleFocusMode() { @@ -30,7 +30,7 @@ BaseContentWindow { if(contentwindow.focused) groupcontroller.unfocus(contentwindow.id) else - groupcontroller.focus(contentwindow.id) + groupcontroller.focusSelected() } function toggleFullscreenMode() { @@ -42,12 +42,6 @@ BaseContentWindow { groupcontroller.showFullscreen(contentwindow.id) } - function toggleMode() { - if(contentwindow.focused) - groupcontroller.unfocus(contentwindow.id) - toggleFullscreenMode() - } - function scaleWindow(center, pixelDelta) { var sign = pixelDelta.x + pixelDelta.y > 0 ? 1.0 : -1.0; var delta = Math.sqrt(pixelDelta.x * pixelDelta.x + @@ -90,12 +84,12 @@ BaseContentWindow { referenceItem: windowRect.parent onTouchStarted: groupcontroller.moveWindowToFront(contentwindow.id) - onTap: if(windowActive) { toggleControlsVisibility() } + onTap: if(windowActive) { toggleSelected() } onTapAndHold: { if(contentwindow.isPanel) // force toggle - contentwindow.controlsVisible = !contentwindow.controlsVisible + contentwindow.selected = !contentwindow.selected } - onDoubleTap: (numPoints > 1) ? toggleFullscreenMode() : toggleFocusMode() + onDoubleTap: (numPoints > 1) ? toggleFocusMode() : toggleFullscreenMode() onPanStarted: { if(windowActive && contentwindow.state === ContentWindow.NONE) @@ -161,7 +155,7 @@ BaseContentWindow { if(contentActive) contentcontroller.tap(pos, numPoints) else if(windowActive) - toggleControlsVisibility() + toggleSelected() } onDoubleTap: { if(contentActive) @@ -169,7 +163,7 @@ BaseContentWindow { else if(contentwindow.fullscreen) controller.toogleFullscreenMaxSize() else - (numPoints > 1) ? toggleFullscreenMode() : toggleFocusMode() + (numPoints > 1) ? toggleFocusMode() : toggleFullscreenMode() } onTapAndHold: { if(contentActive) @@ -301,14 +295,6 @@ BaseContentWindow { mousearea.onClicked: closeWindow() } - ContentWindowButton { - source: "qrc:///img/master/maximize.svg" - anchors.bottom: parent.bottom - anchors.left: parent.left - mousearea.onClicked: toggleMode() - visible: !contentwindow.isPanel - } - ContentWindowButton { source: "qrc:///img/master/resize.svg" anchors.bottom: parent.bottom diff --git a/tide/master/resources/MasterDisplayGroup.qml b/tide/master/resources/MasterDisplayGroup.qml index 0bc5c5d7..172e9b7a 100644 --- a/tide/master/resources/MasterDisplayGroup.qml +++ b/tide/master/resources/MasterDisplayGroup.qml @@ -5,46 +5,57 @@ import "qrc:/qml/core/." import "qrc:/qml/core/style.js" as Style DisplayGroup { - id: dispGroup + id: displaygroupitem showFocusContext: false - signal launcherControlPressed() - signal settingsControlsPressed() + signal openLauncher() + signal hideLauncher() MultitouchArea { anchors.fill: parent - referenceItem: dispGroup + referenceItem: displaygroupitem property bool blockTap: true onTouchStarted: blockTap = false onTapAndHold: { - view.backgroundTapAndHold(pos) blockTap = true; } onTap: { if(!blockTap) - view.backgroundTap(pos) + groupcontroller.deselectAll() } } MultitouchArea { id: touchBarrier anchors.fill: parent - visible: displaygroup.hasFullscreenWindows - z: Style.fullscreenBackgroundZorder - onTap: groupcontroller.exitFullscreen() + visible: displaygroupitem.state !== "" + z: displaygroupitem.focusContextZorder + function goToDesktop() { + if (displaygroup.hasFullscreenWindows) + groupcontroller.exitFullscreen() + else if (displaygroup.hasFocusedWindows) + groupcontroller.unfocusAll() + else if (displaygroup.hasVisiblePanels) + groupcontroller.hidePanels() + } + onTap: goToDesktop() } sideControl.buttonDelegate: MultitouchArea { onTap: { - if(buttonIndex == 0) - launcherControlPressed(); + if(buttonIndex == 0) { + if (displaygroup.hasVisiblePanels) + hideLauncher() + else + openLauncher() + } else if(buttonIndex == 1) groupcontroller.unfocusAll(); else if(buttonIndex == 2) groupcontroller.exitFullscreen(); else if(buttonIndex == 3) - settingsControlsPressed(); + options.showClock = !options.showClock } } } diff --git a/tide/master/ui/DisplayGroupListWidget.cpp b/tide/master/ui/DisplayGroupListWidget.cpp index eb837942..727108dd 100644 --- a/tide/master/ui/DisplayGroupListWidget.cpp +++ b/tide/master/ui/DisplayGroupListWidget.cpp @@ -69,7 +69,7 @@ void DisplayGroupListWidget::setDataModel( DisplayGroupPtr displayGroup ) connect( _displayGroup.get(), &DisplayGroup::contentWindowRemoved, this, &DisplayGroupListWidget::_removeContentWindow ); connect( _displayGroup.get(), &DisplayGroup::contentWindowMovedToFront, - this, &DisplayGroupListWidget::_moveContentWindowToFront ); + this, &DisplayGroupListWidget::_moveToFront ); } void DisplayGroupListWidget::_addContentWindow( ContentWindowPtr contentWindow ) @@ -97,7 +97,7 @@ void DisplayGroupListWidget::_removeContentWindow( ContentWindowPtr } } -void DisplayGroupListWidget::_moveContentWindowToFront( ContentWindowPtr +void DisplayGroupListWidget::_moveToFront( ContentWindowPtr contentWindow ) { for( int i = 0; i < count(); ++i ) @@ -120,5 +120,5 @@ void DisplayGroupListWidget::_moveListWidgetItemToFront( QListWidgetItem* ContentWindowListWidgetItem* windowItem = dynamic_cast< ContentWindowListWidgetItem* >( listWidgetItem ); if( windowItem ) - _displayGroup->moveContentWindowToFront( windowItem->getContentWindow( )); + _displayGroup->moveToFront( windowItem->getContentWindow( )); } diff --git a/tide/master/ui/DisplayGroupListWidget.h b/tide/master/ui/DisplayGroupListWidget.h index a18bbe0c..71791eca 100644 --- a/tide/master/ui/DisplayGroupListWidget.h +++ b/tide/master/ui/DisplayGroupListWidget.h @@ -62,7 +62,7 @@ class DisplayGroupListWidget : public QListWidget private slots: void _addContentWindow( ContentWindowPtr window ); void _removeContentWindow( ContentWindowPtr window ); - void _moveContentWindowToFront( ContentWindowPtr window ); + void _moveToFront( ContentWindowPtr window ); void _moveListWidgetItemToFront( QListWidgetItem* listWidgetItem ); private: diff --git a/tide/master/ui/DisplayGroupView.cpp b/tide/master/ui/DisplayGroupView.cpp index fd4bad39..fb3b4a92 100644 --- a/tide/master/ui/DisplayGroupView.cpp +++ b/tide/master/ui/DisplayGroupView.cpp @@ -115,10 +115,10 @@ void DisplayGroupView::setDataModel( DisplayGroupPtr displayGroup ) controller->setParent( _displayGroupItem ); controller.release(); - connect( _displayGroupItem, SIGNAL( launcherControlPressed( )), - this, SIGNAL( launcherControlPressed( ))); - connect( _displayGroupItem, SIGNAL( settingsControlsPressed( )), - this, SIGNAL( settingsControlsPressed( ))); + connect( _displayGroupItem, SIGNAL( openLauncher( )), + this, SIGNAL( openLauncher( ))); + connect( _displayGroupItem, SIGNAL( hideLauncher( )), + this, SIGNAL( hideLauncher( ))); ContentWindowPtrs contentWindows = _displayGroup->getContentWindows(); for( ContentWindowPtr contentWindow : contentWindows ) @@ -137,16 +137,15 @@ void DisplayGroupView::setDataModel( DisplayGroupPtr displayGroup ) QPointF DisplayGroupView::mapToWallPos( const QPointF& normalizedPos ) const { - const float scale = QQmlProperty::read( _wallObject, "scale" ).toFloat(); - const float offsetX = QQmlProperty::read( _wallObject, "offsetX" ).toFloat(); - const float offsetY = QQmlProperty::read( _wallObject, "offsetY" ).toFloat(); - - const float screenPosX = normalizedPos.x() * _displayGroup->width() * - scale + offsetX; - const float screenPosY = normalizedPos.y() * _displayGroup->height() * - scale + offsetY; - - return QPointF( screenPosX, screenPosY ); + const auto scale = QQmlProperty::read( _wallObject, "scale" ).toFloat(); + const auto offsetX = QQmlProperty::read( _wallObject, "offsetX" ).toFloat(); + const auto offsetY = QQmlProperty::read( _wallObject, "offsetY" ).toFloat(); + + const auto screenPosX = normalizedPos.x() * _displayGroup->width() * + scale + offsetX; + const auto screenPosY = normalizedPos.y() * _displayGroup->height() * + scale + offsetY; + return { screenPosX, screenPosY }; } void DisplayGroupView::_clearScene() @@ -155,9 +154,9 @@ void DisplayGroupView::_clearScene() if( _displayGroupItem ) { - _displayGroupItem->setParentItem( 0 ); + _displayGroupItem->setParentItem( nullptr ); delete _displayGroupItem; - _displayGroupItem = 0; + _displayGroupItem = nullptr; } } diff --git a/tide/master/ui/DisplayGroupView.h b/tide/master/ui/DisplayGroupView.h index 9932c063..d7b4adc5 100644 --- a/tide/master/ui/DisplayGroupView.h +++ b/tide/master/ui/DisplayGroupView.h @@ -72,17 +72,11 @@ class DisplayGroupView : public QQuickView QPointF mapToWallPos( const QPointF& normalizedPos ) const; signals: - /** Emitted when a user taps the background. */ - void backgroundTap( QPointF pos ); + /** Emitted when a user taps the launcher control to open it. */ + void openLauncher(); - /** Emitted when a user taps and holds the background. */ - void backgroundTapAndHold( QPointF pos ); - - /** Emitted when a user taps the launcher control. */ - void launcherControlPressed(); - - /** Emitted when a user taps the settings control. */ - void settingsControlsPressed(); + /** Emitted when a user taps the launcher control to hide it. */ + void hideLauncher(); /** @name Emitted when a user interactacts with the mouse. */ //@{ diff --git a/tide/master/ui/MasterWindow.cpp b/tide/master/ui/MasterWindow.cpp index fc462ace..3b673716 100644 --- a/tide/master/ui/MasterWindow.cpp +++ b/tide/master/ui/MasterWindow.cpp @@ -66,11 +66,11 @@ const QString SESSION_FILES_FILTER( "Session files (*.dcx)" ); const QSize DEFAULT_WINDOW_SIZE( 800, 600 ); } -MasterWindow::MasterWindow( DisplayGroupPtr displayGroup, +MasterWindow::MasterWindow( DisplayGroupPtr displayGroup, OptionsPtr options, MasterConfiguration& config ) : QMainWindow() , _displayGroup( displayGroup ) - , _options( new Options ) + , _options( options ) , _backgroundWidget( new BackgroundWidget( config, this )) #if TIDE_USE_QT5WEBKITWIDGETS || TIDE_USE_QT5WEBENGINE , _webbrowserWidget( new WebbrowserWidget( config, this )) @@ -104,7 +104,7 @@ MasterWindow::MasterWindow( DisplayGroupPtr displayGroup, _displayGroup->setContentWindows( group->getContentWindows( )); _displayGroup->setShowWindowTitles( group->getShowWindowTitles( )); - getOptions()->setShowWindowTitles( group->getShowWindowTitles( )); + _options->setShowWindowTitles( group->getShowWindowTitles( )); }); connect( &_saveSessionOp, &QFutureWatcher::finished, [this]() { @@ -128,11 +128,6 @@ DisplayGroupView* MasterWindow::getDisplayGroupView() return _displayGroupView; } -OptionsPtr MasterWindow::getOptions() const -{ - return _options; -} - void MasterWindow::_setupMasterWindowUI() { // create menus in menu bar @@ -365,32 +360,6 @@ void MasterWindow::_setupMasterWindowUI() mainWidget ); mainWidget->addTab( wrapper, "Display group 0" ); - // Forward background touch events - connect( _displayGroupView, &DisplayGroupView::backgroundTap, - this, &MasterWindow::hideLauncher ); - connect( _displayGroupView, &DisplayGroupView::backgroundTapAndHold, - this, &MasterWindow::openLauncher ); - - // Forward controls touch events - connect( _displayGroupView, &DisplayGroupView::launcherControlPressed, - [this]() - { - for( auto win : _displayGroup->getContentWindows( )) - { - if( win->isPanel() && !win->isHidden( )) - { - emit hideLauncher(); - return; - } - } - emit openLauncher(); - }); - connect( _displayGroupView, &DisplayGroupView::settingsControlsPressed, - [this]() - { - _options->setShowClock( !_options->getShowClock( )); - }); - // create contents dock widget QDockWidget* contentsDockWidget = new QDockWidget( "Contents", this ); QWidget* contentsWidget = new QWidget(); @@ -521,7 +490,7 @@ void MasterWindow::_saveSession() _sessionFolder = QFileInfo( filename ).absoluteDir().path(); - _displayGroup->setShowWindowTitles( getOptions()->getShowWindowTitles( )); + _displayGroup->setShowWindowTitles( _options->getShowWindowTitles( )); _saveSessionOp.setFuture( StateSerializationHelper( _displayGroup ).save( filename )); } diff --git a/tide/master/ui/MasterWindow.h b/tide/master/ui/MasterWindow.h index 40b834f2..feedf4cd 100644 --- a/tide/master/ui/MasterWindow.h +++ b/tide/master/ui/MasterWindow.h @@ -61,7 +61,8 @@ class MasterWindow : public QMainWindow public: /** Constructor. */ - MasterWindow( DisplayGroupPtr displayGroup, MasterConfiguration& config ); + MasterWindow( DisplayGroupPtr displayGroup, OptionsPtr options, + MasterConfiguration& config ); /** Destructor. */ ~MasterWindow(); @@ -69,19 +70,10 @@ class MasterWindow : public QMainWindow /** Get the GraphicsView used for touch interaction. */ DisplayGroupView* getDisplayGroupView(); - /** Get the display options that change during runtime. */ - OptionsPtr getOptions() const; - signals: /** Emitted when users want to open a webbrowser. */ void openWebBrowser( QPointF pos, QSize size, QString url ); - /** Emitted when users want to open the launcher. */ - void openLauncher(); - - /** Emitted when users want to hide the launcher. */ - void hideLauncher(); - protected: /** @name Drag events re-implemented from QMainWindow */ //@{ diff --git a/tide/wall/DisplayGroupRenderer.cpp b/tide/wall/DisplayGroupRenderer.cpp index a8fe9e1f..372b1ff0 100644 --- a/tide/wall/DisplayGroupRenderer.cpp +++ b/tide/wall/DisplayGroupRenderer.cpp @@ -151,7 +151,8 @@ void DisplayGroupRenderer::setDisplayGroup( DisplayGroupPtr displayGroup ) // of the focus context may not always be restored to its original value. // See JIRA issue: DISCL-305 if( !displayGroup->hasFocusedWindows() && - !displayGroup->hasFullscreenWindows( )) + !displayGroup->hasFullscreenWindows() && + !displayGroup->hasVisiblePanels( )) { for( QQuickItem* child : _displayGroupItem->childItems( )) { diff --git a/tide/wall/VisibilityHelper.cpp b/tide/wall/VisibilityHelper.cpp index a237f605..8102a953 100644 --- a/tide/wall/VisibilityHelper.cpp +++ b/tide/wall/VisibilityHelper.cpp @@ -106,7 +106,7 @@ QRectF VisibilityHelper::getVisibleArea( const ContentWindow& window ) const bool isAbove = false; for( auto win : _displayGroup.getContentWindows( )) { - if( win->getID() == window.getID( )) + if( win->getID() == window.getID( ) && !window.isPanel( )) { isAbove = true; continue;