mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System
This commit is contained in:
commit
f6d3d6d34a
@ -2,5 +2,7 @@ include(CMakeFindDependencyMacro)
|
|||||||
find_dependency(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED)
|
find_dependency(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED)
|
||||||
find_dependency(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED)
|
find_dependency(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED)
|
||||||
find_dependency(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)
|
find_dependency(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)
|
||||||
find_dependency(Qt5X11Extras ${REQUIRED_QT_VERSION} REQUIRED)
|
if(UNIX AND NOT APPLE)
|
||||||
|
find_dependency(Qt5X11Extras ${REQUIRED_QT_VERSION} REQUIRED)
|
||||||
|
endif()
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/adsTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/adsTargets.cmake")
|
@ -1,7 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
project(QtAdvancedDockingSystem LANGUAGES CXX VERSION ${VERSION_SHORT})
|
project(QtAdvancedDockingSystem LANGUAGES CXX VERSION ${VERSION_SHORT})
|
||||||
find_package(Qt5 5.5 COMPONENTS Core Gui Widgets REQUIRED)
|
find_package(Qt5 5.5 COMPONENTS Core Gui Widgets REQUIRED)
|
||||||
if (UNIX)
|
if (UNIX AND NOT APPLE)
|
||||||
find_package(Qt5 5.5 COMPONENTS X11Extras REQUIRED)
|
find_package(Qt5 5.5 COMPONENTS X11Extras REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
@ -48,7 +48,7 @@ set(ads_HEADERS
|
|||||||
IconProvider.h
|
IconProvider.h
|
||||||
DockComponentsFactory.h
|
DockComponentsFactory.h
|
||||||
)
|
)
|
||||||
if (UNIX)
|
if (UNIX AND NOT APPLE)
|
||||||
set(ads_SRCS linux/FloatingWidgetTitleBar.cpp ${ads_SRCS})
|
set(ads_SRCS linux/FloatingWidgetTitleBar.cpp ${ads_SRCS})
|
||||||
set(ads_HEADERS linux/FloatingWidgetTitleBar.h ${ads_HEADERS})
|
set(ads_HEADERS linux/FloatingWidgetTitleBar.h ${ads_HEADERS})
|
||||||
endif()
|
endif()
|
||||||
|
@ -240,7 +240,11 @@ void CDockFocusController::onApplicationFocusChanged(QWidget* focusedOld, QWidge
|
|||||||
auto OtherDockWidgetTab = internal::findParent<CDockWidgetTab*>(focusedNow);
|
auto OtherDockWidgetTab = internal::findParent<CDockWidgetTab*>(focusedNow);
|
||||||
if (OtherDockWidgetTab && focusedOld)
|
if (OtherDockWidgetTab && focusedOld)
|
||||||
{
|
{
|
||||||
focusedOld->setFocus();
|
auto OldFocusedDockWidget = internal::findParent<CDockWidget*>(focusedOld);
|
||||||
|
if (OldFocusedDockWidget)
|
||||||
|
{
|
||||||
|
focusedOld->setFocus();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
#include "DockingStateReader.h"
|
#include "DockingStateReader.h"
|
||||||
#include "DockAreaTitleBar.h"
|
#include "DockAreaTitleBar.h"
|
||||||
#include "DockFocusController.h"
|
#include "DockFocusController.h"
|
||||||
|
#include "DockSplitter.h"
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
#include "linux/FloatingWidgetTitleBar.h"
|
#include "linux/FloatingWidgetTitleBar.h"
|
||||||
@ -1093,6 +1094,34 @@ CDockWidget* CDockManager::focusedDockWidget() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//===========================================================================
|
||||||
|
QList<int> CDockManager::splitterSizes(CDockAreaWidget *ContainedArea) const
|
||||||
|
{
|
||||||
|
if (ContainedArea)
|
||||||
|
{
|
||||||
|
auto Splitter = internal::findParent<CDockSplitter*>(ContainedArea);
|
||||||
|
if (Splitter)
|
||||||
|
{
|
||||||
|
return Splitter->sizes();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QList<int>();
|
||||||
|
}
|
||||||
|
|
||||||
|
//===========================================================================
|
||||||
|
void CDockManager::setSplitterSizes(CDockAreaWidget *ContainedArea, const QList<int>& sizes)
|
||||||
|
{
|
||||||
|
if (!ContainedArea)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto Splitter = internal::findParent<CDockSplitter*>(ContainedArea);
|
||||||
|
if (Splitter && Splitter->count() == sizes.count())
|
||||||
|
{
|
||||||
|
Splitter->setSizes(sizes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ads
|
} // namespace ads
|
||||||
|
|
||||||
|
@ -487,6 +487,25 @@ public:
|
|||||||
*/
|
*/
|
||||||
CDockWidget* focusedDockWidget() const;
|
CDockWidget* focusedDockWidget() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the sizes of the splitter that contains the dock area.
|
||||||
|
*
|
||||||
|
* If there is no splitter that contains the area, an empty list will be
|
||||||
|
* returned.
|
||||||
|
*/
|
||||||
|
QList<int> splitterSizes(CDockAreaWidget *ContainedArea) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the sizes of a splitter
|
||||||
|
* Programmatically updates the sizes of a given splitter by calling
|
||||||
|
* QSplitter::setSizes(). The splitter will be the splitter that
|
||||||
|
* contains the supplied dock area widget. If there is not splitter
|
||||||
|
* that contains the dock area, or the sizes supplied does not match
|
||||||
|
* the number of children of the splitter, this method will have no
|
||||||
|
* effect.
|
||||||
|
*/
|
||||||
|
void setSplitterSizes(CDockAreaWidget *ContainedArea, const QList<int>& sizes);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
* Opens the perspective with the given name.
|
* Opens the perspective with the given name.
|
||||||
|
@ -5,7 +5,7 @@ ads--CDockContainerWidget {
|
|||||||
background: palette(dark);
|
background: palette(dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
ads--CDockContainerWidget QSplitter::handle {
|
ads--CDockContainerWidget ads--CDockSplitter::handle {
|
||||||
background: palette(dark);
|
background: palette(dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ ads--CDockContainerWidget {
|
|||||||
background: palette(dark);
|
background: palette(dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
ads--CDockContainerWidget QSplitter::handle {
|
ads--CDockContainerWidget ads--CDockSplitter::handle {
|
||||||
background: palette(dark);
|
background: palette(dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ ads--CDockContainerWidget {
|
|||||||
background: palette(dark);
|
background: palette(dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
ads--CDockContainerWidget QSplitter::handle {
|
ads--CDockContainerWidget ads--CDockSplitter::handle {
|
||||||
background: palette(dark);
|
background: palette(dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,3 +192,4 @@ ads--CFloatingDockContainer[isActiveWindow="true"] #floatingTitleMaximizeButton:
|
|||||||
background: rgba(255, 255, 255, 92);
|
background: rgba(255, 255, 255, 92);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user