mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
refs #299, dockable widgets improvements
* preferred size instead of a auto adjustment for floatable widgets * hack for hiding the tabbar (it still cosnumes space)
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#ifndef BLACKGUI_DOCKWIDGET_H
|
||||
#define BLACKGUI_DOCKWIDGET_H
|
||||
|
||||
#include "components/runtimebasedcomponent.h"
|
||||
#include <QDockWidget>
|
||||
#include <QTabWidget>
|
||||
#include <QMenu>
|
||||
@@ -50,9 +51,6 @@ namespace BlackGui
|
||||
//! Margins when widget is floating
|
||||
void setMarginsWhenDocked(int left, int top, int right, int bottom) { this->m_marginsWhenDocked = QMargins(left, top, right, bottom); }
|
||||
|
||||
//! Auto adjust size when floating
|
||||
void setAutoAdjustWhenFloating(bool autoAdjust) { this->m_autoAdjustWhenFloating = autoAdjust; }
|
||||
|
||||
//! Window title backup
|
||||
const QString &windowTitleBackup() const { return this->m_windowTitleBackup; }
|
||||
|
||||
@@ -62,6 +60,15 @@ namespace BlackGui
|
||||
//! Show the window title when docked
|
||||
void showTitleWhenDocked(bool show);
|
||||
|
||||
//! Reset first time floating
|
||||
void resetWasAlreadyFLoating() { this->m_wasAlreadyFloating = false; }
|
||||
|
||||
//! Was widget already floating
|
||||
bool wasAlreadyFloating() const { return this->m_wasAlreadyFloating; }
|
||||
|
||||
//! Size when floating
|
||||
void setPreferredSizeWhenFloating(const QSize &size) { this->m_preferredSizeWhenFloating = size; }
|
||||
|
||||
public slots:
|
||||
//! Toggle floating
|
||||
void toggleFloating();
|
||||
@@ -101,10 +108,15 @@ namespace BlackGui
|
||||
QMargins m_marginsWhenDocked; //!< Offsets when window is floating
|
||||
QString m_windowTitleBackup; //!< original title, even if the widget title is deleted for layout purposes
|
||||
bool m_windowTitleWhenDocked = true;
|
||||
bool m_autoAdjustWhenFloating = true;
|
||||
bool m_wasAlreadyFloating = false;
|
||||
QSize m_preferredSizeWhenFloating;
|
||||
|
||||
//! Empty widget with no size
|
||||
void initTitleBarWidgets();
|
||||
|
||||
//! Find all embedded runtime components
|
||||
QList<QWidget *> findEmbeddedRuntimeComponents() const;
|
||||
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user