mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-23 10:05:10 -07:00
remove all separate storing of widget sizes, rely on geometry (#6712)
This commit is contained in:
parent
dd8164611b
commit
69c046cca4
9 changed files with 8 additions and 166 deletions
|
|
@ -246,15 +246,6 @@ void TabDeckEditorVisual::showPrintingSelector()
|
|||
printingSelectorDockWidget->setVisible(true);
|
||||
}
|
||||
|
||||
/** @brief Set size restrictions for free floating dock widgets. */
|
||||
void TabDeckEditorVisual::freeDocksSize()
|
||||
{
|
||||
for (auto dockWidget : dockToActions.keys()) {
|
||||
dockWidget->setMinimumSize(100, 100);
|
||||
dockWidget->setMaximumSize(5000, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
/** @brief Refreshes keyboard shortcuts for this tab from settings. */
|
||||
void TabDeckEditorVisual::refreshShortcuts()
|
||||
{
|
||||
|
|
@ -273,17 +264,6 @@ void TabDeckEditorVisual::loadLayout()
|
|||
restoreState(layoutState);
|
||||
restoreGeometry(layouts.getVisualDeckEditorGeometry());
|
||||
}
|
||||
|
||||
for (auto it = dockToActions.constKeyValueBegin(); it != dockToActions.constKeyValueEnd(); ++it) {
|
||||
auto dockWidget = it->first;
|
||||
auto actions = it->second;
|
||||
|
||||
QSize size = layouts.getVisualDeckEditorWidgetSize(dockWidget->objectName(), actions.defaultSize);
|
||||
dockWidget->setMinimumSize(size);
|
||||
dockWidget->setMaximumSize(size);
|
||||
}
|
||||
|
||||
QTimer::singleShot(100, this, &TabDeckEditorVisual::freeDocksSize);
|
||||
}
|
||||
|
||||
/** @brief Resets the layout to default positions and dock states. */
|
||||
|
|
@ -346,10 +326,6 @@ bool TabDeckEditorVisual::eventFilter(QObject *o, QEvent *e)
|
|||
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
||||
layouts.setVisualDeckEditorLayoutState(saveState());
|
||||
layouts.setVisualDeckEditorGeometry(saveGeometry());
|
||||
|
||||
for (auto dockWidget : dockToActions.keys()) {
|
||||
layouts.setVisualDeckEditorWidgetSize(dockWidget->objectName(), dockWidget->size());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,11 +66,6 @@ protected slots:
|
|||
*/
|
||||
void restartLayout() override;
|
||||
|
||||
/**
|
||||
* @brief Set size restrictions for free floating dock widgets.
|
||||
*/
|
||||
void freeDocksSize() override;
|
||||
|
||||
/**
|
||||
* @brief Refresh keyboard shortcuts for this tab.
|
||||
*/
|
||||
|
|
@ -178,4 +173,4 @@ public slots:
|
|||
bool actSaveDeckAs() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue