diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-20 15:42:00 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2013-02-18 21:04:23 (GMT) |
commit | 09a76586dec0059dea3ef9183e417e232a0012a2 (patch) | |
tree | 2d3491053153aadafb4f842b88d995f1a483602d /src | |
parent | 95979a5e611569e50ffb60417a82703125559b4f (diff) | |
download | fluxbox_pavel-09a76586dec0059dea3ef9183e417e232a0012a2.zip fluxbox_pavel-09a76586dec0059dea3ef9183e417e232a0012a2.tar.bz2 |
Attach modifiedSig handlers to the session.screenX.tab.placement resource
Diffstat (limited to 'src')
-rw-r--r-- | src/FbWinFrame.cc | 20 | ||||
-rw-r--r-- | src/Screen.cc | 6 | ||||
-rw-r--r-- | src/Screen.hh | 10 | ||||
-rw-r--r-- | src/Window.cc | 2 |
4 files changed, 21 insertions, 17 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index d51ffdf..21de2c5 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -263,13 +263,13 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int heigh | |||
263 | m_state.saveGeometry(window().x(), window().y(), | 263 | m_state.saveGeometry(window().x(), window().y(), |
264 | window().width(), window().height()); | 264 | window().width(), window().height()); |
265 | 265 | ||
266 | if (move || (resize && m_screen.getTabPlacement() != TOPLEFT && | 266 | if (move || (resize && *m_screen.getTabPlacementResource() != TOPLEFT && |
267 | m_screen.getTabPlacement() != LEFTTOP)) | 267 | *m_screen.getTabPlacementResource() != LEFTTOP)) |
268 | alignTabs(); | 268 | alignTabs(); |
269 | 269 | ||
270 | if (resize) { | 270 | if (resize) { |
271 | if (m_tabmode == EXTERNAL) { | 271 | if (m_tabmode == EXTERNAL) { |
272 | switch(m_screen.getTabPlacement()) { | 272 | switch(*m_screen.getTabPlacementResource()) { |
273 | case LEFTTOP: | 273 | case LEFTTOP: |
274 | case RIGHTTOP: | 274 | case RIGHTTOP: |
275 | case LEFT: | 275 | case LEFT: |
@@ -294,7 +294,7 @@ void FbWinFrame::quietMoveResize(int x, int y, | |||
294 | window().width(), window().height()); | 294 | window().width(), window().height()); |
295 | if (m_tabmode == EXTERNAL) { | 295 | if (m_tabmode == EXTERNAL) { |
296 | 296 | ||
297 | switch(m_screen.getTabPlacement()) { | 297 | switch(*m_screen.getTabPlacementResource()) { |
298 | case LEFTTOP: | 298 | case LEFTTOP: |
299 | case RIGHTTOP: | 299 | case RIGHTTOP: |
300 | case LEFT: | 300 | case LEFT: |
@@ -323,7 +323,7 @@ void FbWinFrame::alignTabs() { | |||
323 | m_tab_container.setMaxSizePerClient(m_screen.getTabWidth()); | 323 | m_tab_container.setMaxSizePerClient(m_screen.getTabWidth()); |
324 | 324 | ||
325 | int tabx = 0, taby = 0; | 325 | int tabx = 0, taby = 0; |
326 | switch (m_screen.getTabPlacement()) { | 326 | switch (*m_screen.getTabPlacementResource()) { |
327 | case TOPLEFT: | 327 | case TOPLEFT: |
328 | if (orig_orient != FbTk::ROT0) m_tab_container.hide(); | 328 | if (orig_orient != FbTk::ROT0) m_tab_container.hide(); |
329 | m_tab_container.setOrientation(FbTk::ROT0); | 329 | m_tab_container.setOrientation(FbTk::ROT0); |
@@ -913,7 +913,7 @@ void FbWinFrame::reconfigure() { | |||
913 | 913 | ||
914 | if (m_tabmode == EXTERNAL) { | 914 | if (m_tabmode == EXTERNAL) { |
915 | unsigned int neww, newh; | 915 | unsigned int neww, newh; |
916 | switch (m_screen.getTabPlacement()) { | 916 | switch (*m_screen.getTabPlacementResource()) { |
917 | case TOPLEFT: | 917 | case TOPLEFT: |
918 | case TOP: | 918 | case TOP: |
919 | case TOPRIGHT: | 919 | case TOPRIGHT: |
@@ -1643,7 +1643,7 @@ int FbWinFrame::widthOffset() const { | |||
1643 | return 0; | 1643 | return 0; |
1644 | 1644 | ||
1645 | // same height offset for top and bottom tabs | 1645 | // same height offset for top and bottom tabs |
1646 | switch (m_screen.getTabPlacement()) { | 1646 | switch (*m_screen.getTabPlacementResource()) { |
1647 | case LEFTTOP: | 1647 | case LEFTTOP: |
1648 | case RIGHTTOP: | 1648 | case RIGHTTOP: |
1649 | case LEFT: | 1649 | case LEFT: |
@@ -1662,7 +1662,7 @@ int FbWinFrame::heightOffset() const { | |||
1662 | if (m_tabmode != EXTERNAL || !m_use_tabs) | 1662 | if (m_tabmode != EXTERNAL || !m_use_tabs) |
1663 | return 0; | 1663 | return 0; |
1664 | 1664 | ||
1665 | switch (m_screen.getTabPlacement()) { | 1665 | switch (*m_screen.getTabPlacementResource()) { |
1666 | case TOPLEFT: | 1666 | case TOPLEFT: |
1667 | case TOP: | 1667 | case TOP: |
1668 | case TOPRIGHT: | 1668 | case TOPRIGHT: |
@@ -1681,7 +1681,7 @@ int FbWinFrame::xOffset() const { | |||
1681 | if (m_tabmode != EXTERNAL || !m_use_tabs) | 1681 | if (m_tabmode != EXTERNAL || !m_use_tabs) |
1682 | return 0; | 1682 | return 0; |
1683 | 1683 | ||
1684 | switch (m_screen.getTabPlacement()) { | 1684 | switch (*m_screen.getTabPlacementResource()) { |
1685 | case LEFTTOP: | 1685 | case LEFTTOP: |
1686 | case LEFT: | 1686 | case LEFT: |
1687 | case LEFTBOTTOM: | 1687 | case LEFTBOTTOM: |
@@ -1697,7 +1697,7 @@ int FbWinFrame::yOffset() const { | |||
1697 | if (m_tabmode != EXTERNAL || !m_use_tabs) | 1697 | if (m_tabmode != EXTERNAL || !m_use_tabs) |
1698 | return 0; | 1698 | return 0; |
1699 | 1699 | ||
1700 | switch (m_screen.getTabPlacement()) { | 1700 | switch (*m_screen.getTabPlacementResource()) { |
1701 | case TOPLEFT: | 1701 | case TOPLEFT: |
1702 | case TOP: | 1702 | case TOP: |
1703 | case TOPRIGHT: | 1703 | case TOPRIGHT: |
diff --git a/src/Screen.cc b/src/Screen.cc index c8e4ad7..2766c06 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -194,9 +194,9 @@ public: | |||
194 | setCloseOnClick(false); | 194 | setCloseOnClick(false); |
195 | } | 195 | } |
196 | 196 | ||
197 | bool isSelected() const { return m_screen.getTabPlacement() == m_place; } | 197 | bool isSelected() const { return *m_screen.getTabPlacementResource() == m_place; } |
198 | void click(int button, int time, unsigned int mods) { | 198 | void click(int button, int time, unsigned int mods) { |
199 | m_screen.saveTabPlacement(m_place); | 199 | *m_screen.getTabPlacementResource() = m_place; |
200 | FbTk::RadioMenuItem::click(button, time, mods); | 200 | FbTk::RadioMenuItem::click(button, time, mods); |
201 | } | 201 | } |
202 | 202 | ||
@@ -1685,7 +1685,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1685 | tabplacement_menu->insert(p.label); | 1685 | tabplacement_menu->insert(p.label); |
1686 | tabplacement_menu->setItemEnabled(i, false); | 1686 | tabplacement_menu->setItemEnabled(i, false); |
1687 | } else | 1687 | } else |
1688 | tabplacement_menu->insert(new TabPlacementMenuItem(p.label, *this, p.placement, save_and_reconftabs)); | 1688 | tabplacement_menu->insert(new TabPlacementMenuItem(p.label, *this, p.placement, saverc_cmd)); |
1689 | } | 1689 | } |
1690 | tabplacement_menu->updateMenu(); | 1690 | tabplacement_menu->updateMenu(); |
1691 | 1691 | ||
diff --git a/src/Screen.hh b/src/Screen.hh index 81812ba..8d50fbc 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -89,6 +89,10 @@ public: | |||
89 | typedef std::vector<std::string> WorkspaceNames; | 89 | typedef std::vector<std::string> WorkspaceNames; |
90 | typedef std::list<std::pair<FbTk::FbString, FbTk::RefCount<FbTk::Menu> > > ExtraMenus; | 90 | typedef std::list<std::pair<FbTk::FbString, FbTk::RefCount<FbTk::Menu> > > ExtraMenus; |
91 | 91 | ||
92 | typedef FbTk::Resource< | ||
93 | FbWinFrame::TabPlacement, FbTk::EnumTraits<FbWinFrame::TabPlacement> | ||
94 | > TabPlacementResource; | ||
95 | |||
92 | BScreen(FbTk::ResourceManager_base &rm, | 96 | BScreen(FbTk::ResourceManager_base &rm, |
93 | const std::string &screenname, | 97 | const std::string &screenname, |
94 | int scrn, int number_of_layers); | 98 | int scrn, int number_of_layers); |
@@ -120,7 +124,7 @@ public: | |||
120 | ExtraMenus &extraWindowMenus() { return m_extramenus; } | 124 | ExtraMenus &extraWindowMenus() { return m_extramenus; } |
121 | const ExtraMenus &extraWindowMenus() const { return m_extramenus; } | 125 | const ExtraMenus &extraWindowMenus() const { return m_extramenus; } |
122 | 126 | ||
123 | FbWinFrame::TabPlacement getTabPlacement() const { return *resource.tab_placement; } | 127 | TabPlacementResource &getTabPlacementResource() { return resource.tab_placement; } |
124 | 128 | ||
125 | unsigned int noFocusWhileTypingDelay() const { return *resource.typing_delay; } | 129 | unsigned int noFocusWhileTypingDelay() const { return *resource.typing_delay; } |
126 | const bool allowRemoteActions() const { return *resource.allow_remote_actions; } | 130 | const bool allowRemoteActions() const { return *resource.allow_remote_actions; } |
@@ -253,8 +257,6 @@ public: | |||
253 | 257 | ||
254 | void setRootColormapInstalled(bool r) { root_colormap_installed = r; } | 258 | void setRootColormapInstalled(bool r) { root_colormap_installed = r; } |
255 | 259 | ||
256 | void saveTabPlacement(FbWinFrame::TabPlacement place) { *resource.tab_placement = place; } | ||
257 | |||
258 | void saveWorkspaces(int w) { *resource.workspaces = w; } | 260 | void saveWorkspaces(int w) { *resource.workspaces = w; } |
259 | 261 | ||
260 | FbTk::ThemeProxy<FbWinFrameTheme> &focusedWinFrameTheme() { return *m_focused_windowtheme.get(); } | 262 | FbTk::ThemeProxy<FbWinFrameTheme> &focusedWinFrameTheme() { return *m_focused_windowtheme.get(); } |
@@ -532,7 +534,7 @@ private: | |||
532 | max_ignore_inc, max_disable_move, max_disable_resize, | 534 | max_ignore_inc, max_disable_move, max_disable_resize, |
533 | workspace_warping, show_window_pos, auto_raise, click_raises; | 535 | workspace_warping, show_window_pos, auto_raise, click_raises; |
534 | FbTk::StringResource default_deco; | 536 | FbTk::StringResource default_deco; |
535 | FbTk::Resource<FbWinFrame::TabPlacement, FbTk::EnumTraits<FbWinFrame::TabPlacement> > tab_placement; | 537 | TabPlacementResource tab_placement; |
536 | FbTk::StringResource windowmenufile; | 538 | FbTk::StringResource windowmenufile; |
537 | FbTk::UIntResource typing_delay; | 539 | FbTk::UIntResource typing_delay; |
538 | FbTk::IntResource workspaces, edge_snap_threshold, focused_alpha, | 540 | FbTk::IntResource workspaces, edge_snap_threshold, focused_alpha, |
diff --git a/src/Window.cc b/src/Window.cc index fae5272..6c2cc66 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -443,6 +443,8 @@ void FluxboxWindow::init() { | |||
443 | 443 | ||
444 | join(screen().getDefaultInternalTabsResource().modifiedSig(), | 444 | join(screen().getDefaultInternalTabsResource().modifiedSig(), |
445 | FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); | 445 | FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); |
446 | join(screen().getTabPlacementResource().modifiedSig(), | ||
447 | FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); | ||
446 | 448 | ||
447 | /**************************************************/ | 449 | /**************************************************/ |
448 | /* Read state above here, apply state below here. */ | 450 | /* Read state above here, apply state below here. */ |