Skip to content

Commit

Permalink
Enabled macOS Menubar in Settings
Browse files Browse the repository at this point in the history
But now there's a Dock icon

Signed-off-by: Elsie Hupp <[email protected]>
  • Loading branch information
elsiehupp committed Mar 2, 2021
1 parent a66db50 commit 57e4096
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmake/modules/MacOSXBundleInfo.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<true/>
<false/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
Expand Down
7 changes: 6 additions & 1 deletion src/gui/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "accountmanager.h"

#include <QLabel>
#include <QMenuBar>
#include <QStandardItemModel>
#include <QStackedWidget>
#include <QPushButton>
Expand Down Expand Up @@ -88,10 +89,14 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
ConfigFile cfg;

_ui->setupUi(this);

_menuBar = new QMenuBar(parent);

_toolBar = new QToolBar;
_toolBar->setIconSize(QSize(32, 32));
_toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
layout()->setMenuBar(_toolBar);
// layout()->addWidget(_toolBar);
layout()->setMenuBar(_menuBar);

// People perceive this as a Window, so also make Ctrl+W work
auto *closeWindowAction = new QAction(this);
Expand Down
2 changes: 2 additions & 0 deletions src/gui/settingsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

class QAction;
class QActionGroup;
class QMenuBar;
class QToolBar;
class QStandardItemModel;

Expand Down Expand Up @@ -89,6 +90,7 @@ private slots:
// case the account avatar changes
QHash<Account *, QAction *> _actionForAccount;

QMenuBar *_menuBar;
QToolBar *_toolBar;

ownCloudGui *_gui;
Expand Down

0 comments on commit 57e4096

Please sign in to comment.