┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-03-26 23:22:21 +0100
committerPeter Penz <[email protected]>2011-03-26 23:26:39 +0100
commit9af429cae1ad040e48679360189fdb5f36de740e (patch)
tree720268ce7f6b629e954b6d2fe2416d39118a82a2 /src/dolphinmainwindow.h
parenta90938c414687b6dd85d34a7c9fc16afa03e0b68 (diff)
Provide toolbar-menu when the menubar is hidden
Use a similar default UI like in Rekonq and other browsers: Hide the menubar and add access to all actions by a button in the toolbar. Of course it is still possible to show the menubar so that the same UI is given like before.
Diffstat (limited to 'src/dolphinmainwindow.h')
-rw-r--r--src/dolphinmainwindow.h42
1 files changed, 25 insertions, 17 deletions
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h
index 9c7753112..7d964cf5f 100644
--- a/src/dolphinmainwindow.h
+++ b/src/dolphinmainwindow.h
@@ -38,13 +38,14 @@
typedef KIO::FileUndoManager::CommandType CommandType;
-class KAction;
class DolphinViewActionHandler;
class DolphinApplication;
class DolphinSettingsDialog;
class DolphinViewContainer;
class DolphinRemoteEncoding;
+class KAction;
class KNewFileMenu;
+class KPushButton;
class KTabBar;
class KUrl;
class QSplitter;
@@ -108,12 +109,6 @@ public:
*/
KNewFileMenu* newFileMenu() const;
- /**
- * Returns the 'Show Menubar' action which can be shared with
- * other menus (e. g. a context menu).
- */
- KAction* showMenuBarAction() const;
-
public slots:
/**
* Pastes the clipboard data into the currently selected folder
@@ -295,9 +290,6 @@ private slots:
*/
void goUp(Qt::MouseButtons buttons);
- /** Goes to the home URL. */
- void goHome();
-
/** Opens Kompare for 2 selected files. */
void compareFiles();
@@ -446,6 +438,12 @@ private slots:
const KUrl& url,
const QList<QAction*>& customActions);
+ void openToolBarMenu();
+ void updateToolBarMenu();
+ void updateToolBar();
+ void slotToolBarSpacerDeleted();
+ void slotToolBarMenuButtonDeleted();
+
private:
DolphinMainWindow(int id);
void init();
@@ -469,6 +467,16 @@ private:
void updateViewActions();
void updateGoActions();
+ void createToolBarMenuButton();
+ void deleteToolBarMenuButton();
+
+ /**
+ * Adds the action \p action to the menu \p menu in
+ * case if it has not added already to the toolbar.
+ * @return True if the action has been added to the menu.
+ */
+ bool addActionToMenu(QAction* action, KMenu* menu);
+
/**
* Adds the tab[\a index] to the closed tab menu's list of actions.
*/
@@ -537,12 +545,12 @@ private:
KNewFileMenu* m_newFileMenu;
KActionMenu* m_recentTabsMenu;
- KAction* m_showMenuBar;
KTabBar* m_tabBar;
DolphinViewContainer* m_activeViewContainer;
QVBoxLayout* m_centralWidgetLayout;
int m_id;
+ // Members for the tab-handling:
struct ViewTab
{
ViewTab() : isPrimaryViewActive(true), primaryView(0), secondaryView(0), splitter(0) {}
@@ -551,7 +559,6 @@ private:
DolphinViewContainer* secondaryView;
QSplitter* splitter;
};
-
int m_tabIndex;
QList<ViewTab> m_viewTab;
@@ -559,6 +566,12 @@ private:
DolphinRemoteEncoding* m_remoteEncoding;
QPointer<DolphinSettingsDialog> m_settingsDialog;
+ // Members for the toolbar menu that is shown when the menubar is hidden:
+ QWidget* m_toolBarSpacer;
+ KPushButton* m_openToolBarMenuButton;
+ QWeakPointer<KMenu> m_toolBarMenu;
+ QTimer* m_updateToolBarTimer;
+
KJob* m_lastHandleUrlStatJob;
/**
@@ -583,11 +596,6 @@ inline KNewFileMenu* DolphinMainWindow::newFileMenu() const
return m_newFileMenu;
}
-inline KAction* DolphinMainWindow::showMenuBarAction() const
-{
- return m_showMenuBar;
-}
-
inline int DolphinMainWindow::getId() const
{
return m_id;