1
0
mirror of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git synced 2025-04-01 02:42:39 +08:00

Merge branch 'auto_hide_feature' of github.com:githubuser0xFFFF/Qt-Advanced-Docking-System into auto_hide_feature

This commit is contained in:
Syarif Fakhri 2022-11-07 08:59:10 +08:00
commit aad16f7af5
36 changed files with 1753 additions and 435 deletions

281
demo/ImageViewer.cpp Normal file
View File

@ -0,0 +1,281 @@
//============================================================================
/// \file ImageViewer.cpp
/// \author Uwe Kindler
/// \date 04.11.2022
/// \brief Implementation of CImageViewer
//============================================================================
//============================================================================
// INCLUDES
//============================================================================
#include "ImageViewer.h"
#include <math.h>
#include <QLabel>
#include <QImageReader>
#include <QImageWriter>
#include <QMessageBox>
#include <QApplication>
#include <QDir>
#include <QColorSpace>
#include <QFileDialog>
#include <QStandardPaths>
#include <QAction>
#include <QScrollBar>
#include <QPixmap>
#include <QPainter>
#include <QImage>
#include <QMouseEvent>
#include <QWheelEvent>
#include "RenderWidget.h"
/**
* Private image viewer data
*/
struct ImageViewerPrivate
{
CImageViewer* _this;
CRenderWidget* RenderWidget;///< renders the image to screen
bool AutoFit;///< automatically fit image to window size on resize events
QSize ImageSize;///< stores the image size to detect image size changes
QPoint MouseMoveStartPos;///< for calculation of mouse move vector
QLabel* ScalingLabel;///< label displays scaling factor
QList<QWidget*> OverlayTools;///< list of tool widget to overlay
ImageViewerPrivate(CImageViewer* _public) : _this(_public) {}
};
//============================================================================
CImageViewer::CImageViewer(QWidget *parent)
: Super(parent),
d(new ImageViewerPrivate(this))
{
d->AutoFit = true;
d->RenderWidget = new CRenderWidget(this);
this->setBackgroundRole(QPalette::Light);
this->setAlignment(Qt::AlignCenter);
this->setWidget(d->RenderWidget);
this->createActions();
this->setMouseTracking(false); // only produce mouse move events if mouse button pressed
}
//============================================================================
CImageViewer::~CImageViewer()
{
delete d;
}
//============================================================================
bool CImageViewer::loadFile(const QString& fileName)
{
QImageReader reader(fileName);
reader.setAutoTransform(true);
const QImage newImage = reader.read();
if (newImage.isNull())
{
QMessageBox::information(this, QGuiApplication::applicationDisplayName(),
tr("Cannot load %1: %2")
.arg(QDir::toNativeSeparators(fileName), reader.errorString()));
return false;
}
setImage(newImage);
setWindowFilePath(fileName);
return true;
}
//===========================================================================
void CImageViewer::setImage(const QImage &newImage)
{
d->RenderWidget->showImage(newImage);
this->adjustDisplaySize(newImage);
}
//============================================================================
void CImageViewer::adjustDisplaySize(const QImage& Image)
{
if (d->ImageSize == Image.size())
{
return;
}
d->ImageSize = Image.size();
if (d->AutoFit)
{
this->fitToWindow();
}
}
//===========================================================================
static void initializeImageFileDialog(QFileDialog &dialog, QFileDialog::AcceptMode acceptMode)
{
static bool firstDialog = true;
if (firstDialog) {
firstDialog = false;
const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
dialog.setDirectory(picturesLocations.isEmpty() ? QDir::currentPath() : picturesLocations.last());
}
QStringList mimeTypeFilters;
const QByteArrayList supportedMimeTypes = acceptMode == QFileDialog::AcceptOpen
? QImageReader::supportedMimeTypes() : QImageWriter::supportedMimeTypes();
for (const QByteArray &mimeTypeName : supportedMimeTypes)
mimeTypeFilters.append(mimeTypeName);
mimeTypeFilters.sort();
dialog.setMimeTypeFilters(mimeTypeFilters);
dialog.selectMimeTypeFilter("image/jpeg");
if (acceptMode == QFileDialog::AcceptSave)
dialog.setDefaultSuffix("jpg");
}
//===========================================================================
void CImageViewer::open()
{
QFileDialog dialog(this, tr("Open File"));
initializeImageFileDialog(dialog, QFileDialog::AcceptOpen);
while (dialog.exec() == QDialog::Accepted && !loadFile(dialog.selectedFiles().first())) {}
}
//===========================================================================
void CImageViewer::createActions()
{
QAction* a;
a = new QAction(tr("&Open..."));
a->setIcon(QIcon(":/adsdemo/images/perm_media.svg"));
connect(a, &QAction::triggered, this, &CImageViewer::open);
a->setShortcut(QKeySequence::Open);;
this->addAction(a);
a = new QAction(tr("Fit on Screen"));
a->setIcon(QIcon(":/adsdemo/images/zoom_out_map.svg"));
connect(a, &QAction::triggered, this, &CImageViewer::fitToWindow);
this->addAction(a);
a = new QAction(tr("Actual Pixels"));
a->setIcon(QIcon(":/adsdemo/images/find_in_page.svg"));
connect(a, &QAction::triggered, this, &CImageViewer::normalSize);
this->addAction(a);
a = new QAction(this);
a->setSeparator(true);
this->addAction(a);
a = new QAction(tr("Zoom In (25%)"));
a->setIcon(QIcon(":/adsdemo/images/zoom_in.svg"));
connect(a, &QAction::triggered, this, &CImageViewer::zoomIn);
this->addAction(a);
a = new QAction(tr("Zoom Out (25%)"));
a->setIcon(QIcon(":/adsdemo/images/zoom_out.svg"));
connect(a, &QAction::triggered, this, &CImageViewer::zoomOut);
this->addAction(a);
this->setContextMenuPolicy(Qt::ActionsContextMenu);
}
//===========================================================================
void CImageViewer::zoomIn()
{
d->AutoFit = false;
d->RenderWidget->zoomIn();
}
//===========================================================================
void CImageViewer::zoomOut()
{
d->AutoFit = false;
d->RenderWidget->zoomOut();
}
//===========================================================================
void CImageViewer::normalSize()
{
d->AutoFit = false;
d->RenderWidget->normalSize();
}
//===========================================================================
void CImageViewer::fitToWindow()
{
d->AutoFit = true;
d->RenderWidget->scaleToSize(this->maximumViewportSize());
}
//============================================================================
void CImageViewer::resizeEvent(QResizeEvent* ResizeEvent)
{
Super::resizeEvent(ResizeEvent);
if (d->AutoFit)
{
this->fitToWindow();
}
}
//============================================================================
void CImageViewer::mousePressEvent(QMouseEvent* Event)
{
d->RenderWidget->setCursor(Qt::ClosedHandCursor);
d->MouseMoveStartPos = Event->pos();
Super::mousePressEvent(Event);
}
//============================================================================
void CImageViewer::mouseReleaseEvent(QMouseEvent* Event)
{
d->RenderWidget->setCursor(Qt::OpenHandCursor);
Super::mouseReleaseEvent(Event);
}
//============================================================================
void CImageViewer::mouseMoveEvent(QMouseEvent* Event)
{
QPoint MoveVector = Event->pos() - d->MouseMoveStartPos;
d->MouseMoveStartPos = Event->pos();
horizontalScrollBar()->setValue(horizontalScrollBar()->value()
- MoveVector.x());
verticalScrollBar()->setValue(verticalScrollBar()->value() - MoveVector.y());
}
//============================================================================
void CImageViewer::wheelEvent(QWheelEvent* Event)
{
double numDegrees = Event->delta() / 8;
double numSteps = numDegrees / 15;
d->AutoFit = false;
double Zoom;
if (numSteps < 0)
{
Zoom = pow(0.9, 0 - numSteps);
}
else
{
Zoom = pow(1.10, numSteps);
}
d->RenderWidget->zoomByValue(Zoom);
}
#include "moc_ImageViewer.cpp"
//---------------------------------------------------------------------------
// EOF ImageViewer.cpp

88
demo/ImageViewer.h Normal file
View File

@ -0,0 +1,88 @@
#ifndef ImageViewerH
#define ImageViewerH
//============================================================================
/// \file ImageViewer.h
/// \author Uwe Kindler
/// \date 04.11.2022
/// \brief Declaration of CImageViewer
//============================================================================
//============================================================================
// INCLUDES
//============================================================================
#include <QScrollArea>
QT_BEGIN_NAMESPACE
class QLabel;
QT_END_NAMESPACE
struct ImageViewerPrivate;
/**
* Tiny simple image viewer for showing images in demo
*/
class CImageViewer : public QScrollArea
{
Q_OBJECT
public:
using Super = QScrollArea;
explicit CImageViewer(QWidget *parent = nullptr);
virtual ~CImageViewer();
bool loadFile(const QString& Filename);
void setImage(const QImage &newImage);
public Q_SLOTS:
void open();
void zoomIn();
void zoomOut();
void normalSize();
void fitToWindow();
protected:
/**
* @brief Reimplemented from QScrollArea to adjust image scaling if m_AutoFit is
* true.
*/
virtual void resizeEvent(QResizeEvent* ResizeEvent);
/**
* @brief Handle mouse press events.
*/
virtual void mousePressEvent(QMouseEvent* Event);
/**
* @brief Handles mouse release events.
*/
virtual void mouseReleaseEvent(QMouseEvent* Event);
/**
* @brief Handle mouse move events.
*/
virtual void mouseMoveEvent(QMouseEvent* Event);
/**
* @brief Use mouse wheel to change scaling of the image.
*/
virtual void wheelEvent(QWheelEvent* Event);
private:
/**
* @brief Create the wiget actions.
*/
void createActions();
/**
* @brief Adjust size of render widget in case of image size change.
* @param[in] Image The new image that may have a different image size.
*/
void adjustDisplaySize(const QImage& Image);
ImageViewerPrivate* d;
friend ImageViewerPrivate;
};
//---------------------------------------------------------------------------
#endif // ImageViewerH

View File

@ -80,6 +80,7 @@
#include "DockComponentsFactory.h"
#include "StatusDialog.h"
#include "DockSplitter.h"
#include "ImageViewer.h"
/**
@ -317,6 +318,22 @@ struct MainWindowPrivate
return DockWidget;
}
/**
* Creates a simply image viewr
*/
ads::CDockWidget* createImageViewer()
{
static int ImageViewerCount = 0;
auto w = new CImageViewer();
auto Result = w->loadFile(":adsdemo/images/ads_logo.svg");
qDebug() << "loadFile result: " << Result;
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Image Viewer %1").arg(ImageViewerCount++));
DockWidget->setWidget(w,ads:: CDockWidget::ForceNoScrollArea);
auto ToolBar = DockWidget->createDefaultToolBar();
ToolBar->addActions(w->actions());
return DockWidget;
}
/**
* Create a table widget
*/
@ -510,6 +527,10 @@ void MainWindowPrivate::createContent()
_this->connect(DockWidget, SIGNAL(viewToggled(bool)), SLOT(onViewToggled(bool)));
_this->connect(DockWidget, SIGNAL(visibilityChanged(bool)), SLOT(onViewVisibilityChanged(bool)));
}
// Create image viewer
DockWidget = createImageViewer();
DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget);
}
@ -561,6 +582,11 @@ void MainWindowPrivate::createActions()
a = ui.menuTests->addAction("Toggle Label 0 Window Title");
_this->connect(a, SIGNAL(triggered()), SLOT(toggleDockWidgetWindowTitle()));
ui.menuTests->addSeparator();
a = ui.toolBar->addAction("Apply VS Style");
a->setToolTip("Applies a Visual Studio light style (visual_studio_light.css)." );
a->setIcon(svgIcon(":/adsdemo/images/color_lens.svg"));
QObject::connect(a, &QAction::triggered, _this, &CMainWindow::applyVsStyle);
}
@ -620,7 +646,7 @@ CMainWindow::CMainWindow(QWidget *parent) :
// uncomment the following line if you want to use opaque undocking and
// opaque splitter resizing
//CDockManager::setConfigFlags(CDockManager::DefaultOpaqueConfig);
// CDockManager::setConfigFlags(CDockManager::DefaultOpaqueConfig);
// uncomment the following line if you want a fixed tab width that does
// not change if the visibility of the close button changes
@ -655,7 +681,6 @@ CMainWindow::CMainWindow(QWidget *parent) :
// uncomment the following line to enable focus highlighting of the dock
// widget that has the focus
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
CDockManager::setConfigFlag(CDockManager::AlwaysShowTabs, true);
// uncomment if you would like to enable dock widget auto hiding
CDockManager::setAutoHideConfigFlags(CDockManager::DefaultAutoHideConfig);
@ -754,7 +779,7 @@ void CMainWindow::onViewToggled(bool Open)
return;
}
qDebug() << DockWidget->objectName() << " viewToggled(" << Open << ")";
//qDebug() << DockWidget->objectName() << " viewToggled(" << Open << ")";
}
@ -865,3 +890,15 @@ void CMainWindow::toggleDockWidgetWindowTitle()
d->WindowTitleTestDockWidget->setWindowTitle(Title);
}
//============================================================================
void CMainWindow::applyVsStyle()
{
QFile StyleSheetFile(":adsdemo/res/visual_studio_light.css");
StyleSheetFile.open(QIODevice::ReadOnly);
QTextStream StyleSheetStream(&StyleSheetFile);
auto Stylesheet = StyleSheetStream.readAll();
StyleSheetFile.close();
d->DockManager->setStyleSheet(Stylesheet);
}

View File

@ -65,6 +65,7 @@ private slots:
void onEditorCloseRequested();
void showStatusDialog();
void toggleDockWidgetWindowTitle();
void applyVsStyle();
};
#endif // MAINWINDOW_H

114
demo/RenderWidget.cpp Normal file
View File

@ -0,0 +1,114 @@
//============================================================================
/// \file RenderWidget.cpp
/// \author Uwe Kindler
/// \date 04.11.2022
/// \brief Implementation of CRenderWidget
//============================================================================
//============================================================================
// INCLUDES
//============================================================================
#include "RenderWidget.h"
#include <QPainter>
#include <math.h>
//===========================================================================
CRenderWidget::CRenderWidget(QWidget* Parent) :
QWidget(Parent), m_ScaleFactor(1)
{
//
// OpaquePaintEvent indicates that we do not need an auto-filled
// background. It is used for widgets filling the whole paint area
// with its own opaque colors and need to draw its contents quickly.
// This applies for a capture widget.
//
this->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
this->setCursor(Qt::OpenHandCursor);
}
//===========================================================================
CRenderWidget::~CRenderWidget()
{
}
//===========================================================================
void CRenderWidget::showImage(const QImage& Image)
{
m_Image = QPixmap::fromImage(Image);
this->adjustWidgetSize();
this->repaint();
}
//===========================================================================
void CRenderWidget::paintEvent(QPaintEvent* Event)
{
Q_UNUSED(Event);
QPainter Painter(this);
Painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
Painter.setRenderHint(QPainter::Antialiasing, true);
Painter.scale(m_ScaleFactor, m_ScaleFactor);
Painter.drawPixmap(QPoint(0, 0), m_Image);
}
//============================================================================
void CRenderWidget::zoomIn()
{
scaleImage(1.25);
}
//============================================================================
void CRenderWidget::zoomOut()
{
scaleImage(0.8);
}
//============================================================================
void CRenderWidget::zoomByValue(double ZoomValue)
{
scaleImage(ZoomValue);
}
//============================================================================
void CRenderWidget::normalSize()
{
m_ScaleFactor = 1;
this->adjustWidgetSize();
}
//============================================================================
void CRenderWidget::scaleImage(double ScaleFactor)
{
m_ScaleFactor *= ScaleFactor;
this->adjustWidgetSize();
}
//============================================================================
void CRenderWidget::adjustWidgetSize()
{
QSize ScaledImageSize = m_Image.size() * m_ScaleFactor;
if (ScaledImageSize != this->size())
{
this->setFixedSize(ScaledImageSize);
}
}
//============================================================================
void CRenderWidget::scaleToSize(const QSize& TargetSize)
{
if (m_Image.isNull())
{
return;
}
double ScaleFactorH = (double) TargetSize.width() / m_Image.size().width();
double ScaleFactorV = (double) TargetSize.height()
/ m_Image.size().height();
m_ScaleFactor = (ScaleFactorH < ScaleFactorV) ? ScaleFactorH : ScaleFactorV;
this->adjustWidgetSize();
}
//---------------------------------------------------------------------------
// EOF RenderWidget.cpp

111
demo/RenderWidget.h Normal file
View File

@ -0,0 +1,111 @@
#ifndef RenderWidgetH
#define RenderWidgetH
//============================================================================
/// \file RenderWidget.h
/// \author Uwe Kindler
/// \date 04.11.2022
/// \brief Declaration of CRenderWidget
//============================================================================
//============================================================================
// INCLUDES
//============================================================================
#include <QWidget>
#include <QPixmap>
//============================================================================
// FORWARD DECLARATIONS
//============================================================================
class QImage;
/**
* @brief Widget for fast display of images (i.e. for video capture devices)
*/
class CRenderWidget : public QWidget
{
Q_OBJECT
private:
QPixmap m_Image;
double m_ScaleFactor;
protected:
/**
* @brief Reimplemented paint event method showing actual image.
*/
void paintEvent(QPaintEvent* PaintEvent);
/**
* @brief Change scale factor
*/
void scaleImage(double ScaleFactor);
/**
* @brief Adjust widget size to size of image.
*/
void adjustWidgetSize();
public:
/**
* Constructor
* @param[in] Parent Parent widget.
*/
CRenderWidget(QWidget* Parent);
/**
* Destructor
*/
virtual ~CRenderWidget();
signals:
/**
* @brief Signalize change of captured image size.
* @param ImageSize New image size.
*/
void imageSizeChanged(const QSize& ImageSize);
public slots:
/**
* @brief Show new image in render widget.
*/
void showImage(const QImage& Image);
/**
* @brief Zoom into the scene.
* This function decreases the scaling factor by setting it to the previous
* value in internal scaling list.
* @brief Steps The number of steps to zoom in. One step is 25%.
*/
void zoomIn();
/**
* @brief Zoom out of the scene.
* This function decreases the scaling factor by setting it to the next
* value in internal scaling list.
* @brief Steps The number of steps to zoom out. One step is 25%.
*/
void zoomOut();
/**
* @brief Change zoom by zoom value.
* @param[in] ZoomValue This is the zoom value to apply. A value of 1
* means no change a value > 1 increases the image (i.e. 1.25 would increase
* the image by 25%) and a value of < 1 decreases the image size (i.e.
* a value of 0.8 would decrease the image size by 25%).
*/
void zoomByValue(double ZoomValue);
/**
* @brief Resets the actual scaling to 1 and display the image with its
* actual pixel size.
*/
void normalSize();
/**
* @brief Scales the wiget and its content image to the given TargetSize
*/
void scaleToSize(const QSize& TargetSize);
}; // class CRenderWidget
//---------------------------------------------------------------------------
#endif // RenderWidgetH

View File

@ -2,7 +2,7 @@ ADS_OUT_ROOT = $${OUT_PWD}/..
TARGET = AdvancedDockingSystemDemo
DESTDIR = $${ADS_OUT_ROOT}/lib
QT += core gui widgets
QT += core gui widgets svg
include(../ads.pri)
@ -20,14 +20,19 @@ adsBuildStatic {
DEFINES += ADS_STATIC
}
SOURCES += \
main.cpp \
MainWindow.cpp \
StatusDialog.cpp
HEADERS += \
MainWindow.h \
StatusDialog.h
StatusDialog.h \
ImageViewer.h \
RenderWidget.h
SOURCES += \
main.cpp \
MainWindow.cpp \
StatusDialog.cpp \
ImageViewer.cpp \
RenderWidget.cpp
FORMS += \
mainwindow.ui \

View File

@ -17,5 +17,14 @@
<file>images/create_floating_editor.svg</file>
<file>images/create_floating_table.svg</file>
<file>images/docked_editor.svg</file>
<file>res/visual_studio_light.css</file>
<file>images/color_lens.svg</file>
<file>images/ads_icon.svg</file>
<file>images/ads_logo.svg</file>
<file>images/find_in_page.svg</file>
<file>images/perm_media.svg</file>
<file>images/zoom_in.svg</file>
<file>images/zoom_out.svg</file>
<file>images/zoom_out_map.svg</file>
</qresource>
</RCC>

77
demo/images/ads_icon.svg Normal file
View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
viewBox="0 0 1023.99 1023.99"
id="svg26"
sodipodi:docname="ads_icon.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
width="1023.99"
height="1023.99"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs30" />
<sodipodi:namedview
id="namedview28"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="0.12999302"
inkscape:cx="3277.099"
inkscape:cy="-257.70614"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg26"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<desc
id="desc2">electric_iron icon - Licensed under Iconfu Standard License v1.0 (https://www.iconfu.com/iconfu_standard_license) - Incors GmbH</desc>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none"
x="1251.1022"
y="1305.4956"
id="text9788"><tspan
sodipodi:role="line"
id="tspan9786"
x="1251.1022"
y="1305.4956" /></text>
<g
id="g94691"
transform="translate(581.23034,1750.5233)">
<path
d="m 191.63966,-726.53328 h -521.75 c -138.69,0 -251.12,-112.43001 -251.12,-251.12 v -521.75002 c 0,-138.69 112.43,-251.12 251.12,-251.12 h 521.75 c 138.69,0 251.12,112.43 251.12,251.12 v 521.75002 c 0,138.68999 -112.43,251.12 -251.12,251.12 z"
fill="#707070"
id="path4-5"
style="mix-blend-mode:normal;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero" />
<path
id="path927"
style="mix-blend-mode:normal;fill:#009ddd;fill-opacity:1;fill-rule:nonzero"
d="m -175.90039,-1515.8633 v 256 h 469.3301 v -256 z" />
<path
id="path16513"
style="mix-blend-mode:normal;fill:#ff9833;fill-opacity:1;fill-rule:nonzero"
d="m 80.099609,-1217.1934 v 256.00004 H 293.42969 v -256.00004 z" />
<path
id="path16513-5"
style="mix-blend-mode:normal;fill:#accb01;fill-opacity:1;fill-rule:nonzero"
d="m -175.90039,-1217.1933 v 256 H 37.42969 v -256 z" />
<path
id="path24788"
style="mix-blend-mode:normal;fill:#0083c3;fill-opacity:1;fill-rule:nonzero"
d="m -431.90039,-1515.8633 v 554.66994 h 213.33008 v -554.66994 z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

88
demo/images/ads_logo.svg Normal file
View File

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
viewBox="0 0 6907.3028 1023.99"
id="svg26"
sodipodi:docname="ads_logo.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
width="6907.3027"
height="1023.99"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs30" />
<sodipodi:namedview
id="namedview28"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="0.12999302"
inkscape:cx="3277.099"
inkscape:cy="-257.70614"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg26"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<desc
id="desc2">electric_iron icon - Licensed under Iconfu Standard License v1.0 (https://www.iconfu.com/iconfu_standard_license) - Incors GmbH</desc>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none"
x="1251.1022"
y="1305.4956"
id="text9788"><tspan
sodipodi:role="line"
id="tspan9786"
x="1251.1022"
y="1305.4956" /></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:628.003px;line-height:1.25;font-family:sans-serif;fill:#8f918f;fill-opacity:1;stroke:none;stroke-width:1"
x="1178.9221"
y="718.37329"
id="text15608"><tspan
sodipodi:role="line"
id="tspan15606"
x="1178.9221"
y="718.37329"
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:628.003px;font-family:'Segoe UI';-inkscape-font-specification:'Segoe UI Light';fill:#8f918f;fill-opacity:1;stroke-width:1">Qt Advanced Docking</tspan></text>
<g
id="g94691"
transform="translate(581.23034,1750.5233)">
<path
d="m 191.63966,-726.53328 h -521.75 c -138.69,0 -251.12,-112.43001 -251.12,-251.12 v -521.75002 c 0,-138.69 112.43,-251.12 251.12,-251.12 h 521.75 c 138.69,0 251.12,112.43 251.12,251.12 v 521.75002 c 0,138.68999 -112.43,251.12 -251.12,251.12 z"
fill="#707070"
id="path4-5"
style="mix-blend-mode:normal;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero" />
<path
id="path927"
style="mix-blend-mode:normal;fill:#009ddd;fill-opacity:1;fill-rule:nonzero"
d="m -175.90039,-1515.8633 v 256 h 469.3301 v -256 z" />
<path
id="path16513"
style="mix-blend-mode:normal;fill:#ff9833;fill-opacity:1;fill-rule:nonzero"
d="m 80.099609,-1217.1934 v 256.00004 H 293.42969 v -256.00004 z" />
<path
id="path16513-5"
style="mix-blend-mode:normal;fill:#accb01;fill-opacity:1;fill-rule:nonzero"
d="m -175.90039,-1217.1933 v 256 H 37.42969 v -256 z" />
<path
id="path24788"
style="mix-blend-mode:normal;fill:#0083c3;fill-opacity:1;fill-rule:nonzero"
d="m -431.90039,-1515.8633 v 554.66994 h 213.33008 v -554.66994 z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,6 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0,0,1024,1024">
<desc>color_lens icon - Licensed under Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - Created with Iconfu.com - Derivative work of Material icons (Copyright Google Inc.)</desc>
<g fill="#03b8e5" fill-rule="nonzero" style="mix-blend-mode: normal">
<path d="M896,469.33c0,117.76 -95.57,213.34 -213.33,213.34h-75.52c-35.41,0 -64,28.59 -64,64c0,16.21 6.4,31.15 16.21,42.24c10.24,11.52 16.64,26.45 16.64,43.09c0,35.41 -28.59,64 -64,64c-212.05,0 -384,-171.95 -384,-384c0,-212.05 171.95,-384 384,-384c212.05,0 384,152.74 384,341.33zM341.33,448c0,-35.41 -28.59,-64 -64,-64c-35.41,0 -64,28.59 -64,64c0,35.41 28.59,64 64,64c35.41,0 64,-28.59 64,-64zM469.33,277.33c0,-35.41 -28.59,-64 -64,-64c-35.41,0 -64,28.59 -64,64c0,35.41 28.59,64 64,64c35.41,0 64,-28.59 64,-64zM682.67,277.33c0,-35.41 -28.59,-64 -64,-64c-35.41,0 -64,28.59 -64,64c0,35.41 28.59,64 64,64c35.41,0 64,-28.59 64,-64zM810.67,448c0,-35.41 -28.59,-64 -64,-64c-35.41,0 -64,28.59 -64,64c0,35.41 28.59,64 64,64c35.41,0 64,-28.59 64,-64z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,6 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0,0,1024,1024">
<desc>find_in_page icon - Licensed under Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - Created with Iconfu.com - Derivative work of Material icons (Copyright Google Inc.)</desc>
<g fill="#03b8e5" fill-rule="nonzero" style="mix-blend-mode: normal">
<path d="M689.92,672c22.19,-33.71 35.41,-73.81 35.41,-117.33c0,-117.76 -95.57,-213.34 -213.33,-213.34c-117.76,0 -213.33,95.58 -213.33,213.34c0,117.76 95.57,213.33 213.33,213.33c43.52,0 83.63,-13.22 117.76,-35.41l189.01,189.01c-14.51,10.67 -31.57,17.07 -50.77,17.07h-512.43c-46.93,0 -84.9,-38.41 -84.9,-85.34l0.42,-682.66c0,-46.93 37.98,-85.34 84.91,-85.34h341.33l256,256v494.51zM512,426.67c70.83,0 128,57.17 128,128c0,70.83 -57.17,128 -128,128c-70.83,0 -128,-57.17 -128,-128c0,-70.83 57.17,-128 128,-128z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 915 B

View File

@ -0,0 +1,6 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0,0,1024,1024">
<desc>perm_media icon - Licensed under Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - Created with Iconfu.com - Derivative work of Material icons (Copyright Google Inc.)</desc>
<g fill="#03b8e5" fill-rule="nonzero" style="mix-blend-mode: normal">
<path d="M1024,256v426.67c0,46.93 -38.4,85.33 -85.33,85.33h-682.67c-46.93,0 -85.33,-38.4 -85.33,-85.33l0.42,-512c0,-46.93 37.98,-85.34 84.91,-85.34h256l85.33,85.34h341.34c46.93,0 85.33,38.4 85.33,85.33zM85.33,853.33h768v85.34h-768c-46.93,0 -85.33,-38.41 -85.33,-85.34l0.43,-384h-0.43v-213.33h85.33zM896,640l-149.33,-192l-106.67,128.43l-149.33,-192.43l-192,256z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 769 B

6
demo/images/zoom_in.svg Normal file
View File

@ -0,0 +1,6 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0,0,1024,1024">
<desc>zoom_in icon - Licensed under Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - Created with Iconfu.com - Derivative work of Material icons (Copyright Google Inc.)</desc>
<g fill="#03b8e5" fill-rule="nonzero" style="mix-blend-mode: normal">
<path d="M874.24,810.67l-63.57,63.57l-213.34,-212.91v-33.7l-11.52,-11.95c-48.64,41.81 -111.79,66.99 -180.48,66.99c-153.17,0 -277.33,-124.17 -277.33,-277.34c0,-153.17 124.16,-277.33 277.33,-277.33c153.17,0 277.34,124.16 277.34,277.33c0,68.69 -25.18,131.84 -66.99,180.48l11.95,11.52h33.7zM597.33,405.33c0,-106.24 -85.76,-192 -192,-192c-106.24,0 -192,85.76 -192,192c0,106.24 85.76,192 192,192c106.24,0 192,-85.76 192,-192zM512,426.67h-85.33v85.33h-42.67v-85.33h-85.33v-42.67h85.33v-85.33h42.67v85.33h85.33z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 909 B

6
demo/images/zoom_out.svg Normal file
View File

@ -0,0 +1,6 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0,0,1024,1024">
<desc>zoom_out icon - Licensed under Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - Created with Iconfu.com - Derivative work of Material icons (Copyright Google Inc.)</desc>
<g fill="#03b8e5" fill-rule="nonzero" style="mix-blend-mode: normal">
<path d="M874.24,810.67l-63.57,63.57l-213.34,-212.91v-33.7l-11.52,-11.95c-48.64,41.81 -111.79,66.99 -180.48,66.99c-153.17,0 -277.33,-124.17 -277.33,-277.34c0,-153.17 124.16,-277.33 277.33,-277.33c153.17,0 277.34,124.16 277.34,277.33c0,68.69 -25.18,131.84 -66.99,180.48l11.95,11.52h33.7zM597.33,405.33c0,-106.24 -85.76,-192 -192,-192c-106.24,0 -192,85.76 -192,192c0,106.24 85.76,192 192,192c106.24,0 192,-85.76 192,-192zM298.67,384h213.33v42.67h-213.33z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 859 B

View File

@ -0,0 +1,6 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0,0,1024,1024">
<desc>zoom_out_map icon - Licensed under Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - Created with Iconfu.com - Derivative work of Material icons (Copyright Google Inc.)</desc>
<g fill="#03b8e5" fill-rule="nonzero" style="mix-blend-mode: normal">
<path d="M896,896h-256l98.13,-98.13l-123.3,-122.46l60.58,-60.58l122.46,123.3l98.13,-98.13zM896,128v256l-98.13,-98.13l-122.46,123.3l-60.58,-60.58l123.3,-122.46l-98.13,-98.13zM128,896v-256l98.13,98.13l122.46,-123.3l60.58,60.58l-123.3,122.46l98.13,98.13zM128,128h256l-98.13,98.13l123.3,122.46l-60.58,60.58l-122.46,-123.3l-98.13,98.13z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 742 B

View File

@ -0,0 +1,379 @@
/*
* Visual Studio like light theme
*/
/*****************************************************************************
* CDockManager
*****************************************************************************/
ads--CDockManager
{
background: palette(window);
}
/*****************************************************************************
* CDockContainerWidget
*****************************************************************************/
ads--CDockContainerWidget {
background: palette(window);
padding: 2px;
}
/*****************************************************************************
* CDockAreaWidget
*****************************************************************************/
ads--CDockAreaWidget {
background: palette(window);
/*border: 1px solid palette(dark);*/
}
ads--CDockAreaTitleBar {
background: transparent;
border-bottom: 2px solid rgb(204, 204, 204);
padding-bottom: 0px;
}
ads--CTitleBarButton {
padding: 0px 0px;
background: transparent;
border: none;
}
ads--CTitleBarButton:hover {
background: rgba(0, 0, 0, 24);
}
ads--CTitleBarButton:pressed {
background: rgba(0, 0, 0, 48);
}
QScrollArea#dockWidgetScrollArea {
padding: 0px;
border: none;
}
#tabsMenuButton::menu-indicator {
image: none;
}
#dockAreaCloseButton {
qproperty-icon: url(:/ads/images/close-button.svg),
url(:/ads/images/close-button-disabled.svg) disabled;
qproperty-iconSize: 16px;
}
#detachGroupButton {
qproperty-icon: url(:/ads/images/detach-button.svg),
url(:/ads/images/detach-button-disabled.svg) disabled;
qproperty-iconSize: 16px;
}
ads--CDockAreaWidget[focused="true"] ads--CDockAreaTitleBar {
border-bottom: 2px solid palette(highlight);
}
/*****************************************************************************
* CDockWidgetTab
*****************************************************************************/
ads--CDockWidgetTab {
background: palette(window);
border: none;
padding: 0 0px;
qproperty-iconSize: 16px 16px;/* this is optional in case you would like to change icon size*/
}
ads--CDockWidgetTab[activeTab="true"] {
background: rgb(204, 204, 204);
}
ads--CDockWidgetTab QLabel {
color: palette(foreground);
}
ads--CDockWidgetTab[activeTab="true"] QLabel {
color: palette(foreground);
}
#tabCloseButton {
margin-top: 2px;
background: none;
border: none;
padding: 0px -2px;
qproperty-icon: url(:/ads/images/close-button.svg),
url(:/ads/images/close-button-disabled.svg) disabled;
qproperty-iconSize: 16px;
}
#tabCloseButton:hover {
/*border: 1px solid rgba(0, 0, 0, 32);*/
background: rgba(0, 0, 0, 24);
}
#tabCloseButton:pressed {
background: rgba(0, 0, 0, 48);
}
/* Focus related styling */
ads--CDockWidgetTab[focused="true"] {
background: palette(highlight);
border-color: palette(highlight);
}
ads--CDockWidgetTab[focused="true"] > #tabCloseButton {
qproperty-icon: url(:/ads/images/close-button-focused.svg)
}
ads--CDockWidgetTab[focused="true"]>#tabCloseButton:hover {
background: rgba(255, 255, 255, 48);
}
ads--CDockWidgetTab[focused="true"]>#tabCloseButton:pressed {
background: rgba(255, 255, 255, 92);
}
ads--CDockWidgetTab[focused="true"] QLabel {
color: palette(light);
}
/*****************************************************************************
* CDockWidget
*****************************************************************************/
ads--CDockWidget {
background: palette(light);
border: 1px solid rgb(204, 204, 204);
border-top: none;
}
/*****************************************************************************
*
* Styling of auto hide functionality
*
*****************************************************************************/
/*****************************************************************************
* CAutoHideTab
*****************************************************************************/
ads--CAutoHideTab {
qproperty-iconSize: 16px 16px;/* this is optional in case you would like to change icon size*/
background: none;
border: none;
padding-left: 2px;
padding-right: 0px;
text-align: center;
min-height: 20px;
padding-bottom: 2px;
}
ads--CAutoHideTab:hover
{
color: palette(highlight);
}
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="0"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="2"] {
border-top: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="1"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="3"] {
border-bottom: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="0"],
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="2"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="0"][activeTab="true"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="2"][activeTab="true"] {
border-top: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="1"],
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="3"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="1"][activeTab="true"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="3"][activeTab="true"] {
border-bottom: 6px solid palette(highlight);
}
/**
* Auto hide tabs with icon only
*/
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="0"] {
border-top: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="1"] {
border-left: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="2"] {
border-right: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="3"] {
border-bottom: 6px solid rgba(0, 0, 0, 48);
}
/**
* Auto hide tabs with icon only hover
*/
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="0"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="0"][activeTab="true"] {
border-top: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="1"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="1"][activeTab="true"] {
border-left: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="2"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="2"][activeTab="true"] {
border-right: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="3"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="3"][activeTab="true"] {
border-bottom: 6px solid palette(highlight);
}
/*****************************************************************************
* CAutoHideSideBar
*****************************************************************************/
ads--CAutoHideSideBar{
background: palette(window);
border: none;
qproperty-spacing: 12;
}
#sideTabsContainerWidget {
background: transparent;
}
ads--CAutoHideSideBar[sideBarLocation="0"] {
border-bottom: 1px solid palette(dark);
}
ads--CAutoHideSideBar[sideBarLocation="1"] {
border-right: 1px solid palette(dark);
}
ads--CAutoHideSideBar[sideBarLocation="2"] {
border-left: 1px solid palette(dark);
}
ads--CAutoHideSideBar[sideBarLocation="3"] {
border-top: 1px solid palette(dark);
}
/*****************************************************************************
* CAutoHideDockContainer
*****************************************************************************/
ads--CAutoHideDockContainer {
background: palette(window);
}
ads--CAutoHideDockContainer ads--CDockAreaTitleBar {
background: palette(highlight);
padding: 0px;
border: none;
}
/*
* This is required because the ads--CDockAreaWidget[focused="true"] will
* overwrite the ads--CAutoHideDockContainer ads--CDockAreaTitleBar rule
*/
ads--CAutoHideDockContainer ads--CDockAreaWidget[focused="true"] ads--CDockAreaTitleBar {
background: palette(highlight);
padding: 0px;
border: none;
}
#autoHideTitleLabel {
padding-left: 4px;
color: palette(light);
}
/*****************************************************************************
* CAutoHideDockContainer titlebar buttons
*****************************************************************************/
#dockAreaAutoHideButton {
qproperty-icon: url(:/ads/images/vs-pin-button.svg);
qproperty-iconSize: 16px;
}
ads--CAutoHideDockContainer #dockAreaAutoHideButton {
qproperty-icon: url(:/ads/images/vs-pin-button-pinned-focused.svg);
qproperty-iconSize: 16px;
}
ads--CAutoHideDockContainer #dockAreaCloseButton{
qproperty-icon: url(:/ads/images/close-button-focused.svg)
}
ads--CAutoHideDockContainer ads--CTitleBarButton:hover {
background: rgba(255, 255, 255, 48);
}
ads--CAutoHideDockContainer ads--CTitleBarButton:pressed {
background: rgba(255, 255, 255, 96);
}
/*****************************************************************************
* CAutoHideDockContainer Titlebar and Buttons
*****************************************************************************/
/*****************************************************************************
* CResizeHandle
*****************************************************************************/
ads--CResizeHandle {
background: palette(window);
}
ads--CAutoHideDockContainer[sideBarLocation="0"] ads--CResizeHandle {
border-top: 1px solid palette(dark);
}
ads--CAutoHideDockContainer[sideBarLocation="1"] ads--CResizeHandle {
border-left: 1px solid palette(dark);
}
ads--CAutoHideDockContainer[sideBarLocation="2"] ads--CResizeHandle {
border-right: 1px solid palette(dark);
}
ads--CAutoHideDockContainer[sideBarLocation="3"] ads--CResizeHandle {
border-top: 1px solid palette(dark);
}

View File

@ -35,6 +35,7 @@
#include <QSplitter>
#include <QPointer>
#include <QApplication>
#include <QCursor>
#include "DockManager.h"
#include "DockWidgetTab.h"
@ -147,7 +148,7 @@ struct AutoHideDockContainerPrivate
*/
void updateResizeHandleSizeLimitMax()
{
auto Rect = _this->parentContainer()->contentRect();
auto Rect = _this->dockContainer()->contentRect();
const auto maxResizeHandleSize = ResizeHandle->orientation() == Qt::Horizontal
? Rect.width() : Rect.height();
ResizeHandle->setMaxResizeSize(maxResizeHandleSize - ResizeMargin);
@ -161,6 +162,18 @@ struct AutoHideDockContainerPrivate
return isHorizontalArea(SideTabBarArea);
}
/**
* Forward this event to the dock container
*/
void forwardEventToDockContainer(QEvent* event)
{
auto DockContainer = _this->dockContainer();
if (DockContainer)
{
DockContainer->handleAutoHideWidgetEvent(event, _this);
}
}
}; // struct AutoHideDockContainerPrivate
@ -174,7 +187,7 @@ AutoHideDockContainerPrivate::AutoHideDockContainerPrivate(
//============================================================================
CDockContainerWidget* CAutoHideDockContainer::parentContainer() const
CDockContainerWidget* CAutoHideDockContainer::dockContainer() const
{
if (d->DockArea)
{
@ -231,7 +244,7 @@ CAutoHideDockContainer::CAutoHideDockContainer(CDockWidget* DockWidget, SideBarL
//============================================================================
void CAutoHideDockContainer::updateSize()
{
auto dockContainerParent = parentContainer();
auto dockContainerParent = dockContainer();
if (!dockContainerParent)
{
return;
@ -281,9 +294,9 @@ CAutoHideDockContainer::~CAutoHideDockContainer()
// Remove event filter in case there are any queued messages
qApp->removeEventFilter(this);
if (parentContainer())
if (dockContainer())
{
parentContainer()->removeAutoHideWidget(this);
dockContainer()->removeAutoHideWidget(this);
}
if (d->SideTab)
@ -297,7 +310,7 @@ CAutoHideDockContainer::~CAutoHideDockContainer()
//============================================================================
CAutoHideSideBar* CAutoHideDockContainer::sideBar() const
{
return parentContainer()->sideTabBar(d->SideTabBarArea);
return dockContainer()->sideTabBar(d->SideTabBarArea);
}
@ -366,7 +379,7 @@ void CAutoHideDockContainer::moveContentsToParent()
// location like it had as a auto hide widget. This brings the least surprise
// to the user and he does not have to search where the widget was inserted.
d->DockWidget->setDockArea(nullptr);
parentContainer()->addDockWidget(d->getDockWidgetArea(d->SideTabBarArea), d->DockWidget);
dockContainer()->addDockWidget(d->getDockWidgetArea(d->SideTabBarArea), d->DockWidget);
}
@ -479,7 +492,7 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
}
else if (event->type() == QEvent::MouseButtonPress)
{
auto Container = parentContainer();
auto Container = dockContainer();
// First we check, if the mouse button press is inside the container
// widget. If it is not, i.e. if someone resizes the main window or
// clicks into the application menu or toolbar, then we ignore the
@ -543,5 +556,38 @@ void CAutoHideDockContainer::resizeEvent(QResizeEvent* event)
}
}
//============================================================================
void CAutoHideDockContainer::leaveEvent(QEvent *event)
{
// Resizing of the dock container via the resize handle in non opaque mode
// mays cause a leave event that is not really a leave event. Therefore
// we check here, if we are really outside of our rect.
auto pos = mapFromGlobal(QCursor::pos());
if (!rect().contains(pos))
{
d->forwardEventToDockContainer(event);
}
Super::leaveEvent(event);
}
//============================================================================
bool CAutoHideDockContainer::event(QEvent* event)
{
switch (event->type())
{
case QEvent::Enter:
case QEvent::Hide:
d->forwardEventToDockContainer(event);
break;
default:
break;
}
return Super::event(event);
}
}

View File

@ -59,8 +59,11 @@ private:
friend CAutoHideSideBar;
protected:
bool eventFilter(QObject* watched, QEvent* event) override;
void resizeEvent(QResizeEvent* event) override;
virtual bool eventFilter(QObject* watched, QEvent* event) override;
virtual void resizeEvent(QResizeEvent* event) override;
virtual void leaveEvent(QEvent *event) override;
virtual bool event(QEvent* event) override;
/**
* Updates the size considering the size limits and the resize margins
@ -124,7 +127,7 @@ public:
/**
* Returns the parent container that hosts this auto hide container
*/
CDockContainerWidget* parentContainer() const;
CDockContainerWidget* dockContainer() const;
/**
* Moves the contents to the parent container widget

View File

@ -100,11 +100,11 @@ public:
/**
* Forward event handling to EventHandler
*/
/*virtual bool event(QEvent* e) override
virtual bool event(QEvent* e) override
{
EventHandler->handleViewportEvent(e);
return Super::event(e);
}*/
}
};

View File

@ -30,6 +30,7 @@
#include "AutoHideTab.h"
#include <QBoxLayout>
#include <QApplication>
#include "AutoHideDockContainer.h"
#include "AutoHideSideBar.h"
@ -59,6 +60,26 @@ struct AutoHideTabPrivate
* the side bar
*/
void updateOrientation();
/**
* Convenience function to ease dock container access
*/
CDockContainerWidget* dockContainer() const
{
return DockWidget ? DockWidget->dockContainer() : nullptr;
}
/**
* Forward this event to the dock container
*/
void forwardEventToDockContainer(QEvent* event)
{
auto DockContainer = dockContainer();
if (DockContainer)
{
DockContainer->handleAutoHideWidgetEvent(event, _this);
}
}
}; // struct DockWidgetTabPrivate
@ -73,42 +94,17 @@ AutoHideTabPrivate::AutoHideTabPrivate(CAutoHideTab* _public) :
//============================================================================
void AutoHideTabPrivate::updateOrientation()
{
auto area = SideBar->sideBarLocation();
_this->setOrientation((area == SideBarBottom || area == SideBarTop) ? Qt::Horizontal : Qt::Vertical);
if (_this->icon().isNull())
{
return;
}
bool IconOnly = false;
switch (area)
{
case SideBarLocation::SideBarLeft:
IconOnly = CDockManager::testAutoHideConfigFlag(CDockManager::LeftSideBarIconOnly);
break;
case SideBarLocation::SideBarRight:
IconOnly = CDockManager::testAutoHideConfigFlag(CDockManager::RightSideBarIconOnly);
break;
case SideBarLocation::SideBarTop:
IconOnly = CDockManager::testAutoHideConfigFlag(CDockManager::BottomSideBarIconOnly);
break;
case SideBarLocation::SideBarBottom:
IconOnly = CDockManager::testAutoHideConfigFlag(CDockManager::TopSideBarIconOnly);
break;
default:
break;
}
if (IconOnly)
bool IconOnly = CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideSideBarsIconOnly);
if (IconOnly && !_this->icon().isNull())
{
_this->setText("");
_this->setOrientation(Qt::Horizontal);
}
else
{
auto area = SideBar->sideBarLocation();
_this->setOrientation((area == SideBarBottom || area == SideBarTop) ? Qt::Horizontal : Qt::Vertical);
}
}
@ -226,6 +222,31 @@ void CAutoHideTab::setDockWidget(CDockWidget* DockWidget)
d->DockWidget = DockWidget;
setText(DockWidget->windowTitle());
setIcon(d->DockWidget->icon());
setToolTip(DockWidget->windowTitle());
}
//============================================================================
bool CAutoHideTab::event(QEvent* event)
{
switch (event->type())
{
case QEvent::Enter:
case QEvent::Leave:
case QEvent::MouseButtonPress:
d->forwardEventToDockContainer(event);
break;
default:
break;
}
return Super::event(event);
}
//============================================================================
bool CAutoHideTab::iconOnly() const
{
return CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideSideBarsIconOnly) && !icon().isNull();
}
}

View File

@ -53,6 +53,7 @@ class ADS_EXPORT CAutoHideTab : public CPushButton
Q_PROPERTY(int sideBarLocation READ sideBarLocation)
Q_PROPERTY(Qt::Orientation orientation READ orientation)
Q_PROPERTY(bool activeTab READ isActiveTab)
Q_PROPERTY(bool iconOnly READ iconOnly)
private:
AutoHideTabPrivate* d; ///< private data (pimpl)
@ -67,6 +68,7 @@ protected:
void setSideBar(CAutoHideSideBar *SideTabBar);
void removeFromSideBar();
virtual bool event(QEvent* event) override;
public:
using Super = CPushButton;
@ -118,6 +120,12 @@ public:
* Sets the dock widget that is controlled by this tab
*/
void setDockWidget(CDockWidget* DockWidget);
/**
* Returns true if the auto hide config flag AutoHideSideBarsIconOnly
* is set and if the tab has an icon - that means the icon is not null
*/
bool iconOnly() const;
}; // class AutoHideTab
}
// namespace ads

View File

@ -38,6 +38,7 @@
#include <QMouseEvent>
#include <QDebug>
#include <QPointer>
#include <QApplication>
#include "DockAreaTitleBar_p.h"
#include "ads_globals.h"
@ -209,7 +210,7 @@ void DockAreaTitleBarPrivate::createButtons()
AutoHideButton = new CTitleBarButton(testAutoHideConfigFlag(CDockManager::DockAreaHasAutoHideButton) && autoHideEnabled);
AutoHideButton->setObjectName("dockAreaAutoHideButton");
AutoHideButton->setAutoRaise(true);
internal::setToolTip(AutoHideButton, QObject::tr("Toggle Auto Hide"));
internal::setToolTip(AutoHideButton, _this->titleBarButtonToolTip(TitleBarButtonAutoHide));
internal::setButtonIcon(AutoHideButton, QStyle::SP_DialogOkButton, ads::AutoHideIcon);
AutoHideButton->setSizePolicy(ButtonSizePolicy);
AutoHideButton->setCheckable(testAutoHideConfigFlag(CDockManager::AutoHideButtonCheckable));
@ -222,7 +223,7 @@ void DockAreaTitleBarPrivate::createButtons()
CloseButton->setObjectName("dockAreaCloseButton");
CloseButton->setAutoRaise(true);
internal::setButtonIcon(CloseButton, QStyle::SP_TitleBarCloseButton, ads::DockAreaCloseIcon);
internal::setToolTip(CloseButton, _this->closeGroupToolTip());
internal::setToolTip(CloseButton, _this->titleBarButtonToolTip(TitleBarButtonClose));
CloseButton->setSizePolicy(ButtonSizePolicy);
CloseButton->setIconSize(QSize(16, 16));
Layout->addWidget(CloseButton, 0);
@ -507,7 +508,8 @@ void CDockAreaTitleBar::onCurrentTabChanged(int Index)
//============================================================================
void CDockAreaTitleBar::onAutoHideButtonClicked()
{
if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideButtonTogglesArea))
if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideButtonTogglesArea)
|| qApp->keyboardModifiers().testFlag(Qt::ControlModifier))
{
d->DockArea->toggleAutoHide();
}
@ -698,13 +700,13 @@ void CDockAreaTitleBar::contextMenuEvent(QContextMenuEvent* ev)
Action->setEnabled(d->DockArea->features().testFlag(CDockWidget::DockWidgetFloatable));
if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideFeatureEnabled))
{
Action = Menu.addAction(isAutoHide ? tr("Dock") : tr("Auto Hide Group"), this, SLOT(onAutoHideDockAreaActionClicked()));
Action = Menu.addAction(isAutoHide ? tr("Unpin (Dock)") : tr("Pin Group"), this, SLOT(onAutoHideDockAreaActionClicked()));
auto AreaIsPinnable = d->DockArea->features().testFlag(CDockWidget::DockWidgetPinnable);
Action->setEnabled(AreaIsPinnable);
if (!isAutoHide)
{
auto menu = Menu.addMenu(tr("Auto Hide Group To..."));
auto menu = Menu.addMenu(tr("Pin Group To..."));
menu->setEnabled(AreaIsPinnable);
d->createAutoHideToAction(tr("Top"), SideBarTop, menu);
d->createAutoHideToAction(tr("Left"), SideBarLeft, menu);
@ -738,19 +740,47 @@ int CDockAreaTitleBar::indexOf(QWidget *widget) const
}
//============================================================================
QString CDockAreaTitleBar::closeGroupToolTip() const
QString CDockAreaTitleBar::titleBarButtonToolTip(TitleBarButton Button) const
{
if (d->DockArea->isAutoHide())
switch (Button)
{
return QObject::tr("Close Overlay");
}
if (CDockManager::testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
{
return QObject::tr("Close Active Tab");
case TitleBarButtonAutoHide:
if (d->DockArea->isAutoHide())
{
return tr("Unpin (Dock)");
}
if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideButtonTogglesArea))
{
return tr("Pin Group");
}
else
{
return tr("Pin Active Tab (Press Ctrl to Pin Group)");
}
break;
case TitleBarButtonClose:
if (d->DockArea->isAutoHide())
{
return tr("Close");
}
if (CDockManager::testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
{
return tr("Close Active Tab");
}
else
{
return tr("Close Group");
}
break;
default:
break;
}
return QObject::tr("Close Group") ;
return QString();
}
//============================================================================

View File

@ -161,7 +161,7 @@ public:
* Close group tool tip based on the current state
* Auto hide widgets can only have one dock widget so it does not make sense for the tooltip to show close group
*/
QString closeGroupToolTip() const;
QString titleBarButtonToolTip(TitleBarButton Button) const;
Q_SIGNALS:
/**

View File

@ -465,7 +465,7 @@ void CDockAreaWidget::setAutoHideDockContainer(CAutoHideDockContainer* AutoHideD
{
d->AutoHideDockContainer = AutoHideDockContainer;
updateAutoHideButtonCheckState();
updateTitleBarButtonToolTip();
updateTitleBarButtonsToolTips();
}
@ -880,9 +880,12 @@ void CDockAreaWidget::updateTitleBarButtonVisibility(bool IsTopLevel) const
//============================================================================
void CDockAreaWidget::updateTitleBarButtonToolTip()
void CDockAreaWidget::updateTitleBarButtonsToolTips()
{
internal::setToolTip(titleBarButton(TitleBarButtonClose), titleBar()->closeGroupToolTip());
internal::setToolTip(titleBarButton(TitleBarButtonClose),
titleBar()->titleBarButtonToolTip(TitleBarButtonClose));
internal::setToolTip(titleBarButton(TitleBarButtonAutoHide),
titleBar()->titleBarButtonToolTip(TitleBarButtonAutoHide));
}

View File

@ -87,7 +87,7 @@ private Q_SLOTS:
/*
* Update the title bar button tooltips
*/
void updateTitleBarButtonToolTip();
void updateTitleBarButtonsToolTips();
/**
* Calculate the auto hide side bar location depending on the dock area

View File

@ -28,9 +28,6 @@
//============================================================================
// INCLUDES
//============================================================================
#include <AutoHideDockContainer.h>
#include <AutoHideSideBar.h>
#include <AutoHideTab.h>
#include "DockContainerWidget.h"
#include <QEvent>
@ -42,6 +39,10 @@
#include <QXmlStreamWriter>
#include <QAbstractButton>
#include <QLabel>
#include <QTimer>
#include <QMetaObject>
#include <QMetaType>
#include <QApplication>
#include "DockManager.h"
#include "DockAreaWidget.h"
@ -54,6 +55,9 @@
#include "DockWidgetTab.h"
#include "DockAreaTitleBar.h"
#include "DockFocusController.h"
#include "AutoHideDockContainer.h"
#include "AutoHideSideBar.h"
#include "AutoHideTab.h"
#include <functional>
#include <iostream>
@ -146,6 +150,9 @@ public:
CDockAreaWidget* LastAddedAreaCache[5];
int VisibleDockAreaCount = -1;
CDockAreaWidget* TopLevelDockArea = nullptr;
QTimer DelayedAutoHideTimer;
CAutoHideTab* DelayedAutoHideTab;
bool DelayedAutoHideShow = false;
/**
* Private data constructor
@ -371,6 +378,13 @@ DockContainerWidgetPrivate::DockContainerWidgetPrivate(CDockContainerWidget* _pu
_this(_public)
{
std::fill(std::begin(LastAddedAreaCache),std::end(LastAddedAreaCache), nullptr);
DelayedAutoHideTimer.setSingleShot(true);
DelayedAutoHideTimer.setInterval(500);
QObject::connect(&DelayedAutoHideTimer, &QTimer::timeout, [this](){
auto GlobalPos = DelayedAutoHideTab->mapToGlobal(QPoint(0, 0));
qApp->sendEvent(DelayedAutoHideTab, new QMouseEvent(QEvent::MouseButtonPress,
QPoint(0, 0), GlobalPos, Qt::LeftButton, {Qt::LeftButton}, Qt::NoModifier));
});
}
@ -2045,6 +2059,88 @@ CDockManager* CDockContainerWidget::dockManager() const
{
return d->DockManager;
}
//===========================================================================
void CDockContainerWidget::handleAutoHideWidgetEvent(QEvent* e, QWidget* w)
{
if (!CDockManager::testAutoHideConfigFlag(CDockManager::ShowAutoHideOnMouseOver))
{
return;
}
if (dockManager()->isRestoringState())
{
return;
}
auto AutoHideTab = qobject_cast<CAutoHideTab*>(w);
if (AutoHideTab)
{
switch (e->type())
{
case QEvent::Enter:
if (!AutoHideTab->dockWidget()->isVisible())
{
d->DelayedAutoHideTab = AutoHideTab;
d->DelayedAutoHideShow = true;
d->DelayedAutoHideTimer.start();
}
else
{
d->DelayedAutoHideTimer.stop();
}
break;
case QEvent::MouseButtonPress:
d->DelayedAutoHideTimer.stop();
break;
case QEvent::Leave:
if (AutoHideTab->dockWidget()->isVisible())
{
d->DelayedAutoHideTab = AutoHideTab;
d->DelayedAutoHideShow = false;
d->DelayedAutoHideTimer.start();
}
else
{
d->DelayedAutoHideTimer.stop();
}
break;
default:
break;
}
return;
}
auto AutoHideContainer = qobject_cast<CAutoHideDockContainer*>(w);
if (AutoHideContainer)
{
switch (e->type())
{
case QEvent::Enter:
case QEvent::Hide:
d->DelayedAutoHideTimer.stop();
break;
case QEvent::Leave:
if (AutoHideContainer->isVisible())
{
d->DelayedAutoHideTab = AutoHideContainer->autoHideTab();
d->DelayedAutoHideShow = false;
d->DelayedAutoHideTimer.start();
}
break;
default:
break;
}
return;
return;
}
}
} // namespace ads
//---------------------------------------------------------------------------

View File

@ -52,6 +52,9 @@ class CFloatingDragPreview;
struct FloatingDragPreviewPrivate;
class CDockingStateReader;
class CAutoHideSideBar;
class CAutoHideTab;
struct AutoHideTabPrivate;
struct AutoHideDockContainerPrivate;
/**
@ -76,7 +79,10 @@ private:
friend class CDockWidget;
friend class CFloatingDragPreview;
friend struct FloatingDragPreviewPrivate;
friend class CAutoHideDockContainer;
friend CAutoHideDockContainer;
friend CAutoHideTab;
friend AutoHideTabPrivate;
friend AutoHideDockContainerPrivate;
protected:
/**
@ -190,6 +196,11 @@ protected:
*/
void removeAutoHideWidget(CAutoHideDockContainer* AutoHideWidget);
/**
* Handles widget events of auto hide widgets to trigger delayed show
* or hide actions for auto hide container on auto hide tab mouse over
*/
void handleAutoHideWidgetEvent(QEvent* e, QWidget* w);
public:
/**

View File

@ -238,11 +238,8 @@ public:
DockAreaHasAutoHideButton = 0x02, //!< If the flag is set each dock area has a auto hide menu button
AutoHideButtonTogglesArea = 0x04, //!< If the flag is set, the auto hide button enables auto hiding for all dock widgets in an area, if disabled, only the current dock widget will be toggled
AutoHideButtonCheckable = 0x08, //!< If the flag is set, the auto hide button will be checked and unchecked depending on the auto hide state. Mainly for styling purposes.
LeftSideBarIconOnly = 0x10, //!< If the flag is set left side bar will show only icon if a the dock widget has an icon assigned
RightSideBarIconOnly = 0x20, //!< If the flag is set right side bar will show only icon if a the dock widget has an icon assigned
BottomSideBarIconOnly = 0x40,//!< If the flag is set bottom side show only icon if a the dock widget has an icon assigned
TopSideBarIconOnly = 0x80, //!< If the flag is set top side bar show only icon if a the dock widget has an icon assigned
AutoHideSideBarsIconOnly = LeftSideBarIconOnly | RightSideBarIconOnly | BottomSideBarIconOnly | TopSideBarIconOnly,
AutoHideSideBarsIconOnly = 0x10,///< show only icons in auto hide side tab - if a tab has no icon, then the text will be shown
ShowAutoHideOnMouseOver = 0x20, ///< show the auto hide window on mouse over tab and hide it if mouse leaves auto hide container
DefaultAutoHideConfig = AutoHideFeatureEnabled
| DockAreaHasAutoHideButton ///< the default configuration for the auto hide feature

View File

@ -532,11 +532,11 @@ void CDockWidgetTab::contextMenuEvent(QContextMenuEvent* ev)
Action->setEnabled(isDetachable);
if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideFeatureEnabled))
{
Action = Menu.addAction(tr("Auto Hide"), this, SLOT(autoHideDockWidget()));
Action = Menu.addAction(tr("Pin"), this, SLOT(autoHideDockWidget()));
auto IsPinnable = d->DockWidget->features().testFlag(CDockWidget::DockWidgetPinnable);
Action->setEnabled(IsPinnable);
auto menu = Menu.addMenu(tr("Auto Hide To..."));
auto menu = Menu.addMenu(tr("Pin To..."));
menu->setEnabled(IsPinnable);
d->createAutoHideToAction(tr("Top"), SideBarTop, menu);
d->createAutoHideToAction(tr("Left"), SideBarLeft, menu);

View File

@ -17,7 +17,6 @@
<file>images/restore-button-focused.svg</file>
<file>images/vs-pin-button.svg</file>
<file>images/vs-pin-button-pinned.svg</file>
<file>stylesheets/visual_studio_light.css</file>
<file>images/vs-pin-button-pinned-focused.svg</file>
</qresource>
</RCC>

View File

@ -142,40 +142,81 @@ ads--CAutoHideTab {
}
ads--CAutoHideTab[sideBarLocation="0"],
ads--CAutoHideTab[sideBarLocation="2"] {
ads--CAutoHideTab:hover
{
color: palette(highlight);
}
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="0"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="2"] {
border-top: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[sideBarLocation="1"],
ads--CAutoHideTab[sideBarLocation="3"] {
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="1"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="3"] {
border-bottom: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab:hover[sideBarLocation="0"],
ads--CAutoHideTab:hover[sideBarLocation="2"] {
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="0"],
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="2"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="0"][activeTab="true"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="2"][activeTab="true"] {
border-top: 6px solid palette(highlight);
color: palette(highlight);
}
ads--CAutoHideTab:hover[sideBarLocation="1"],
ads--CAutoHideTab:hover[sideBarLocation="3"] {
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="1"],
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="3"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="1"][activeTab="true"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="3"][activeTab="true"] {
border-bottom: 6px solid palette(highlight);
color: palette(highlight);
}
ads--CAutoHideTab[sideBarLocation="0"][activeTab="true"],
ads--CAutoHideTab[sideBarLocation="2"][activeTab="true"] {
/**
* Auto hide tabs with icon only
*/
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="0"] {
border-top: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="1"] {
border-left: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="2"] {
border-right: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="3"] {
border-bottom: 6px solid rgba(0, 0, 0, 48);
}
/**
* Auto hide tabs with icon only hover
*/
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="0"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="0"][activeTab="true"] {
border-top: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="1"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="1"][activeTab="true"] {
border-left: 6px solid palette(highlight);
}
ads--CAutoHideTab[sideBarLocation="1"][activeTab="true"],
ads--CAutoHideTab[sideBarLocation="3"][activeTab="true"] {
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="2"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="2"][activeTab="true"] {
border-right: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="3"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="3"][activeTab="true"] {
border-bottom: 6px solid palette(highlight);
}

View File

@ -178,40 +178,81 @@ ads--CAutoHideTab {
}
ads--CAutoHideTab[sideBarLocation="0"],
ads--CAutoHideTab[sideBarLocation="2"] {
ads--CAutoHideTab:hover
{
color: palette(highlight);
}
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="0"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="2"] {
border-top: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[sideBarLocation="1"],
ads--CAutoHideTab[sideBarLocation="3"] {
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="1"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="3"] {
border-bottom: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab:hover[sideBarLocation="0"],
ads--CAutoHideTab:hover[sideBarLocation="2"] {
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="0"],
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="2"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="0"][activeTab="true"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="2"][activeTab="true"] {
border-top: 6px solid palette(highlight);
color: palette(highlight);
}
ads--CAutoHideTab:hover[sideBarLocation="1"],
ads--CAutoHideTab:hover[sideBarLocation="3"] {
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="1"],
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="3"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="1"][activeTab="true"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="3"][activeTab="true"] {
border-bottom: 6px solid palette(highlight);
color: palette(highlight);
}
ads--CAutoHideTab[sideBarLocation="0"][activeTab="true"],
ads--CAutoHideTab[sideBarLocation="2"][activeTab="true"] {
/**
* Auto hide tabs with icon only
*/
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="0"] {
border-top: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="1"] {
border-left: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="2"] {
border-right: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="3"] {
border-bottom: 6px solid rgba(0, 0, 0, 48);
}
/**
* Auto hide tabs with icon only hover
*/
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="0"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="0"][activeTab="true"] {
border-top: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="1"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="1"][activeTab="true"] {
border-left: 6px solid palette(highlight);
}
ads--CAutoHideTab[sideBarLocation="1"][activeTab="true"],
ads--CAutoHideTab[sideBarLocation="3"][activeTab="true"] {
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="2"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="2"][activeTab="true"] {
border-right: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="3"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="3"][activeTab="true"] {
border-bottom: 6px solid palette(highlight);
}

View File

@ -179,44 +179,86 @@ ads--CAutoHideTab {
}
ads--CAutoHideTab[sideBarLocation="0"],
ads--CAutoHideTab[sideBarLocation="2"] {
ads--CAutoHideTab:hover
{
color: palette(highlight);
}
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="0"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="2"] {
border-top: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[sideBarLocation="1"],
ads--CAutoHideTab[sideBarLocation="3"] {
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="1"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="3"] {
border-bottom: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab:hover[sideBarLocation="0"],
ads--CAutoHideTab:hover[sideBarLocation="2"] {
border-top: 6px solid palette(highlight);
color: palette(highlight);
}
ads--CAutoHideTab:hover[sideBarLocation="1"],
ads--CAutoHideTab:hover[sideBarLocation="3"] {
border-bottom: 6px solid palette(highlight);
color: palette(highlight);
}
ads--CAutoHideTab[sideBarLocation="0"][activeTab="true"],
ads--CAutoHideTab[sideBarLocation="2"][activeTab="true"] {
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="0"],
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="2"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="0"][activeTab="true"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="2"][activeTab="true"] {
border-top: 6px solid palette(highlight);
}
ads--CAutoHideTab[sideBarLocation="1"][activeTab="true"],
ads--CAutoHideTab[sideBarLocation="3"][activeTab="true"] {
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="1"],
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="3"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="1"][activeTab="true"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="3"][activeTab="true"] {
border-bottom: 6px solid palette(highlight);
}
/**
* Auto hide tabs with icon only
*/
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="0"] {
border-top: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="1"] {
border-left: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="2"] {
border-right: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="3"] {
border-bottom: 6px solid rgba(0, 0, 0, 48);
}
/**
* Auto hide tabs with icon only hover
*/
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="0"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="0"][activeTab="true"] {
border-top: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="1"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="1"][activeTab="true"] {
border-left: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="2"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="2"][activeTab="true"] {
border-right: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="3"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="3"][activeTab="true"] {
border-bottom: 6px solid palette(highlight);
}
/*****************************************************************************
* CAutoHideSideBar
*****************************************************************************/

View File

@ -254,40 +254,81 @@ ads--CAutoHideTab {
}
ads--CAutoHideTab[sideBarLocation="0"],
ads--CAutoHideTab[sideBarLocation="2"] {
ads--CAutoHideTab:hover
{
color: palette(highlight);
}
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="0"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="2"] {
border-top: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[sideBarLocation="1"],
ads--CAutoHideTab[sideBarLocation="3"] {
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="1"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="3"] {
border-bottom: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab:hover[sideBarLocation="0"],
ads--CAutoHideTab:hover[sideBarLocation="2"] {
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="0"],
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="2"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="0"][activeTab="true"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="2"][activeTab="true"] {
border-top: 6px solid palette(highlight);
color: palette(highlight);
}
ads--CAutoHideTab:hover[sideBarLocation="1"],
ads--CAutoHideTab:hover[sideBarLocation="3"] {
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="1"],
ads--CAutoHideTab:hover[iconOnly="false"][sideBarLocation="3"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="1"][activeTab="true"],
ads--CAutoHideTab[iconOnly="false"][sideBarLocation="3"][activeTab="true"] {
border-bottom: 6px solid palette(highlight);
color: palette(highlight);
}
ads--CAutoHideTab[sideBarLocation="0"][activeTab="true"],
ads--CAutoHideTab[sideBarLocation="2"][activeTab="true"] {
/**
* Auto hide tabs with icon only
*/
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="0"] {
border-top: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="1"] {
border-left: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="2"] {
border-right: 6px solid rgba(0, 0, 0, 48);
}
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="3"] {
border-bottom: 6px solid rgba(0, 0, 0, 48);
}
/**
* Auto hide tabs with icon only hover
*/
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="0"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="0"][activeTab="true"] {
border-top: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="1"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="1"][activeTab="true"] {
border-left: 6px solid palette(highlight);
}
ads--CAutoHideTab[sideBarLocation="1"][activeTab="true"],
ads--CAutoHideTab[sideBarLocation="3"][activeTab="true"] {
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="2"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="2"][activeTab="true"] {
border-right: 6px solid palette(highlight);
}
ads--CAutoHideTab:hover[iconOnly="true"][sideBarLocation="3"],
ads--CAutoHideTab[iconOnly="true"][sideBarLocation="3"][activeTab="true"] {
border-bottom: 6px solid palette(highlight);
}

View File

@ -1,287 +0,0 @@
/*
* Default style sheet on Windows Platforms with focus highlighting flag enabled
*/
ads--CDockManager
{
background: palette(window);
}
ads--CDockContainerWidget {
background: palette(window);
padding: 2px;
}
/*ads--CDockContainerWidget > QSplitter{
padding: 1 0 1 0;
}*/
ads--CDockAreaWidget {
background: palette(window);
/*border: 1px solid palette(dark);*/
}
ads--CDockWidgetTab {
background: palette(window);
border: none;
padding: 0 0px;
qproperty-iconSize: 16px 16px;/* this is optional in case you would like to change icon size*/
}
ads--CDockWidgetTab[activeTab="true"] {
background: rgb(204, 204, 204);
}
ads--CDockWidgetTab QLabel {
color: palette(foreground);
}
ads--CDockWidgetTab[activeTab="true"] QLabel {
color: palette(foreground);
}
ads--CDockWidget {
background: palette(light);
/*border-color: palette(dark);
border-style: solid;
border-width: 1px 0 0 0;*/
border: 1px solid rgb(204, 204, 204);
border-top: none;
}
ads--CTitleBarButton {
padding: 0px 0px;
background: transparent;
border: none;
}
ads--CTitleBarButton:hover {
background: rgba(0, 0, 0, 24);
}
ads--CTitleBarButton:pressed {
background: rgba(0, 0, 0, 48);
}
QScrollArea#dockWidgetScrollArea {
padding: 0px;
border: none;
}
#tabsMenuButton::menu-indicator {
image: none;
}
#tabCloseButton {
margin-top: 2px;
background: none;
border: none;
padding: 0px -2px;
qproperty-icon: url(:/ads/images/close-button.svg),
url(:/ads/images/close-button-disabled.svg) disabled;
qproperty-iconSize: 16px;
}
#tabCloseButton:hover {
/*border: 1px solid rgba(0, 0, 0, 32);*/
background: rgba(0, 0, 0, 24);
}
#tabCloseButton:pressed {
background: rgba(0, 0, 0, 48);
}
#dockAreaCloseButton {
qproperty-icon: url(:/ads/images/close-button.svg),
url(:/ads/images/close-button-disabled.svg) disabled;
qproperty-iconSize: 16px;
}
#detachGroupButton {
qproperty-icon: url(:/ads/images/detach-button.svg),
url(:/ads/images/detach-button-disabled.svg) disabled;
qproperty-iconSize: 16px;
}
ads--CDockSplitter::handle {
/*background-color: palette(dark);*/
/* uncomment the following line if you would like to change the size of
the splitter handles */
/* height: 1px; */
}
/* Focus related styling */
ads--CDockWidgetTab[focused="true"] {
background: palette(highlight);
border-color: palette(highlight);
}
ads--CDockWidgetTab[focused="true"] > #tabCloseButton {
qproperty-icon: url(:/ads/images/close-button-focused.svg)
}
ads--CDockWidgetTab[focused="true"]>#tabCloseButton:hover {
background: rgba(255, 255, 255, 48);
}
ads--CDockWidgetTab[focused="true"]>#tabCloseButton:pressed {
background: rgba(255, 255, 255, 92);
}
ads--CDockWidgetTab[focused="true"] QLabel {
color: palette(light);
}
ads--CDockAreaTitleBar {
background: transparent;
border-bottom: 2px solid rgb(204, 204, 204);
padding-bottom: 0px;
}
ads--CDockAreaWidget[focused="true"] ads--CDockAreaTitleBar {
border-bottom: 2px solid palette(highlight);
}
/*-----------------------------------------------------------------------------
* Styling of auto hide functionality
*----------------------------------------------------------------------------
*/
ads--CAutoHideTab {
/*background: palette(window);*/
qproperty-iconSize: 16px 16px;/* this is optional in case you would like to change icon size*/
}
ads--CAutoHideTab
{
background: none;
border: none;
padding-left: 2px;
padding-right: 0px;
text-align: center;
}
ads--CAutoHideTab[sideBarLocation="0"],
ads--CAutoHideTab[sideBarLocation="2"]
{
border-top: 5px solid rgba(0, 0, 0, 48);
margin-right: 6px;
min-height: 20;
}
ads--CAutoHideTab[sideBarLocation="1"],
ads--CAutoHideTab[sideBarLocation="3"]
{
border-bottom: 5px solid rgba(0, 0, 0, 48);
margin-right: 6px;
min-height: 20;
}
ads--CAutoHideTab:hover[sideBarLocation="0"],
ads--CAutoHideTab:hover[sideBarLocation="2"]
{
border-top: 5px solid palette(highlight);
color: palette(highlight);
}
ads--CAutoHideTab:hover[sideBarLocation="1"],
ads--CAutoHideTab:hover[sideBarLocation="3"]
{
border-bottom: 5px solid palette(highlight);
color: palette(highlight);
}
ads--CAutoHideTab[sideBarLocation="0"][activeTab="true"],
ads--CAutoHideTab[sideBarLocation="2"][activeTab="true"]
{
border-top: 5px solid palette(highlight);
}
ads--CAutoHideTab[sideBarLocation="1"][activeTab="true"],
ads--CAutoHideTab[sideBarLocation="3"][activeTab="true"]
{
border-bottom: 5px solid palette(highlight);
}
/*
ads--CAutoHideDockContainer::handle {
background: palette(dark);
}
ads--CAutoHideDockContainer::handle:vertical {
height: 4px;
}
ads--CAutoHideDockContainer::handle:horizontal {
width: 4px;
}
*/
/*ads--CAutoHideDockContainer[sideBarLocation="0"]:handle {
border: 1px solid palette(dark);
background: white;
}*/
#dockAreaAutoHideButton {
qproperty-icon: url(:/ads/images/vs-pin-button.svg);
qproperty-iconSize: 16px;
}
ads--CAutoHideDockContainer #dockAreaAutoHideButton
{
qproperty-icon: url(:/ads/images/vs-pin-button-pinned-focused.svg);
qproperty-iconSize: 16px;
}
#autoHideTitleLabel
{
padding-left: 4px;
color: palette(light);
}
ads--CResizeHandle
{
/*background: red;
border: 1px solid green;*/
}
ads--CAutoHideDockContainer
{
background: palette(window);
}
ads--CAutoHideDockContainer ads--CDockAreaTitleBar
{
background: palette(highlight);
border: none;
padding: 0px;
}
ads--CAutoHideDockContainer #dockAreaCloseButton
{
qproperty-icon: url(:/ads/images/close-button-focused.svg)
}
ads--CAutoHideDockContainer ads--CTitleBarButton:hover
{
background: rgba(255, 255, 255, 48);
}
ads--CAutoHideDockContainer ads--CTitleBarButton:pressed
{
background: rgba(255, 255, 255, 96);
}