aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/widgets
diff options
context:
space:
mode:
authorleo78913 <leo3758@riseup.net>2022-12-30 21:08:10 -0300
committerleo78913 <leo3758@riseup.net>2023-01-20 19:45:43 -0300
commitf3acf35aeac63e63c845368115686393b4bb09ad (patch)
treefed6b6936ca44ae3cdfdf90944ecfb023be06a91 /launcher/ui/widgets
parent3da1d6a464b1f9ce9d058f37b9b7c8841a0f0c85 (diff)
downloadPrismLauncher-f3acf35aeac63e63c845368115686393b4bb09ad.tar.gz
PrismLauncher-f3acf35aeac63e63c845368115686393b4bb09ad.tar.bz2
PrismLauncher-f3acf35aeac63e63c845368115686393b4bb09ad.zip
refactor: Port the main window to a .ui file
some stuff still needs to be done in the c++ side because qt designer is dumb >:( the instance toolbar icon and instance name buttons are still added manually inside MainWindow.cpp looks almost identical, with some minor tweaks: - the instance toolbar is now a WideBar, so you can customize what actions you want :D - the instance toolbar buttons are now fullwidth - the close window button is now at the end of the file menu - the help menu has some layout changes this also fixes some stuff: - menus not having tooltips - the top toolbar not connecting to the title bar in kde - the instance toolbar separators looking weird after you move the toolbar Signed-off-by: leo78913 <leo3758@riseup.net>
Diffstat (limited to 'launcher/ui/widgets')
-rw-r--r--launcher/ui/widgets/WideBar.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/launcher/ui/widgets/WideBar.cpp b/launcher/ui/widgets/WideBar.cpp
index cee2038f..a029b0a8 100644
--- a/launcher/ui/widgets/WideBar.cpp
+++ b/launcher/ui/widgets/WideBar.cpp
@@ -10,6 +10,9 @@ class ActionButton : public QToolButton {
ActionButton(QAction* action, QWidget* parent = nullptr) : QToolButton(parent), m_action(action)
{
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+ setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+ // workaround for breeze and breeze forks
+ setProperty("_kde_toolButton_alignment", Qt::AlignLeft);
connect(action, &QAction::changed, this, &ActionButton::actionChanged);
connect(this, &ActionButton::clicked, action, &QAction::trigger);
@@ -21,6 +24,10 @@ class ActionButton : public QToolButton {
{
setEnabled(m_action->isEnabled());
setChecked(m_action->isChecked());
+ setMenu(m_action->menu());
+ if (menu()) {
+ setPopupMode(QToolButton::MenuButtonPopup);
+ }
setCheckable(m_action->isCheckable());
setText(m_action->text());
setIcon(m_action->icon());