diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-20 15:42:00 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-11-01 09:57:23 (GMT) |
commit | 0326af9b428e5406c465c2efa00ede8d963671f3 (patch) | |
tree | 3ff392afa66b8961bf4200fcc89df9a4abc7921f | |
parent | 87fa1eaf5724a90a1a623302884c55cb6a3f474d (diff) | |
download | fluxbox_paul-0326af9b428e5406c465c2efa00ede8d963671f3.zip fluxbox_paul-0326af9b428e5406c465c2efa00ede8d963671f3.tar.bz2 |
Attach modifiedSig handlers to the session.screenX.tab.placement resource
-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 04e7944..6aa65b0 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -260,13 +260,13 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int heigh | |||
260 | m_state.saveGeometry(window().x(), window().y(), | 260 | m_state.saveGeometry(window().x(), window().y(), |
261 | window().width(), window().height()); | 261 | window().width(), window().height()); |
262 | 262 | ||
263 | if (move || (resize && m_screen.getTabPlacement() != TOPLEFT && | 263 | if (move || (resize && *m_screen.getTabPlacementResource() != TOPLEFT && |
264 | m_screen.getTabPlacement() != LEFTTOP)) | 264 | *m_screen.getTabPlacementResource() != LEFTTOP)) |
265 | alignTabs(); | 265 | alignTabs(); |
266 | 266 | ||
267 | if (resize) { | 267 | if (resize) { |
268 | if (m_tabmode == EXTERNAL) { | 268 | if (m_tabmode == EXTERNAL) { |
269 | switch(m_screen.getTabPlacement()) { | 269 | switch(*m_screen.getTabPlacementResource()) { |
270 | case LEFTTOP: | 270 | case LEFTTOP: |
271 | case RIGHTTOP: | 271 | case RIGHTTOP: |
272 | case LEFT: | 272 | case LEFT: |
@@ -291,7 +291,7 @@ void FbWinFrame::quietMoveResize(int x, int y, | |||
291 | window().width(), window().height()); | 291 | window().width(), window().height()); |
292 | if (m_tabmode == EXTERNAL) { | 292 | if (m_tabmode == EXTERNAL) { |
293 | 293 | ||
294 | switch(m_screen.getTabPlacement()) { | 294 | switch(*m_screen.getTabPlacementResource()) { |
295 | case LEFTTOP: | 295 | case LEFTTOP: |
296 | case RIGHTTOP: | 296 | case RIGHTTOP: |
297 | case LEFT: | 297 | case LEFT: |
@@ -320,7 +320,7 @@ void FbWinFrame::alignTabs() { | |||
320 | m_tab_container.setMaxSizePerClient(m_screen.getTabWidth()); | 320 | m_tab_container.setMaxSizePerClient(m_screen.getTabWidth()); |
321 | 321 | ||
322 | int tabx = 0, taby = 0; | 322 | int tabx = 0, taby = 0; |
323 | switch (m_screen.getTabPlacement()) { | 323 | switch (*m_screen.getTabPlacementResource()) { |
324 | case TOPLEFT: | 324 | case TOPLEFT: |
325 | if (orig_orient != FbTk::ROT0) m_tab_container.hide(); | 325 | if (orig_orient != FbTk::ROT0) m_tab_container.hide(); |
326 | m_tab_container.setOrientation(FbTk::ROT0); | 326 | m_tab_container.setOrientation(FbTk::ROT0); |
@@ -910,7 +910,7 @@ void FbWinFrame::reconfigure() { | |||
910 | 910 | ||
911 | if (m_tabmode == EXTERNAL) { | 911 | if (m_tabmode == EXTERNAL) { |
912 | unsigned int neww, newh; | 912 | unsigned int neww, newh; |
913 | switch (m_screen.getTabPlacement()) { | 913 | switch (*m_screen.getTabPlacementResource()) { |
914 | case TOPLEFT: | 914 | case TOPLEFT: |
915 | case TOP: | 915 | case TOP: |
916 | case TOPRIGHT: | 916 | case TOPRIGHT: |
@@ -1640,7 +1640,7 @@ int FbWinFrame::widthOffset() const { | |||
1640 | return 0; | 1640 | return 0; |
1641 | 1641 | ||
1642 | // same height offset for top and bottom tabs | 1642 | // same height offset for top and bottom tabs |
1643 | switch (m_screen.getTabPlacement()) { | 1643 | switch (*m_screen.getTabPlacementResource()) { |
1644 | case LEFTTOP: | 1644 | case LEFTTOP: |
1645 | case RIGHTTOP: | 1645 | case RIGHTTOP: |
1646 | case LEFT: | 1646 | case LEFT: |
@@ -1659,7 +1659,7 @@ int FbWinFrame::heightOffset() const { | |||
1659 | if (m_tabmode != EXTERNAL || !m_use_tabs) | 1659 | if (m_tabmode != EXTERNAL || !m_use_tabs) |
1660 | return 0; | 1660 | return 0; |
1661 | 1661 | ||
1662 | switch (m_screen.getTabPlacement()) { | 1662 | switch (*m_screen.getTabPlacementResource()) { |
1663 | case TOPLEFT: | 1663 | case TOPLEFT: |
1664 | case TOP: | 1664 | case TOP: |
1665 | case TOPRIGHT: | 1665 | case TOPRIGHT: |
@@ -1678,7 +1678,7 @@ int FbWinFrame::xOffset() const { | |||
1678 | if (m_tabmode != EXTERNAL || !m_use_tabs) | 1678 | if (m_tabmode != EXTERNAL || !m_use_tabs) |
1679 | return 0; | 1679 | return 0; |
1680 | 1680 | ||
1681 | switch (m_screen.getTabPlacement()) { | 1681 | switch (*m_screen.getTabPlacementResource()) { |
1682 | case LEFTTOP: | 1682 | case LEFTTOP: |
1683 | case LEFT: | 1683 | case LEFT: |
1684 | case LEFTBOTTOM: | 1684 | case LEFTBOTTOM: |
@@ -1694,7 +1694,7 @@ int FbWinFrame::yOffset() const { | |||
1694 | if (m_tabmode != EXTERNAL || !m_use_tabs) | 1694 | if (m_tabmode != EXTERNAL || !m_use_tabs) |
1695 | return 0; | 1695 | return 0; |
1696 | 1696 | ||
1697 | switch (m_screen.getTabPlacement()) { | 1697 | switch (*m_screen.getTabPlacementResource()) { |
1698 | case TOPLEFT: | 1698 | case TOPLEFT: |
1699 | case TOP: | 1699 | case TOP: |
1700 | case TOPRIGHT: | 1700 | case TOPRIGHT: |
diff --git a/src/Screen.cc b/src/Screen.cc index d8ec167..0772048 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -192,9 +192,9 @@ public: | |||
192 | setCloseOnClick(false); | 192 | setCloseOnClick(false); |
193 | } | 193 | } |
194 | 194 | ||
195 | bool isSelected() const { return m_screen.getTabPlacement() == m_place; } | 195 | bool isSelected() const { return *m_screen.getTabPlacementResource() == m_place; } |
196 | void click(int button, int time, unsigned int mods) { | 196 | void click(int button, int time, unsigned int mods) { |
197 | m_screen.saveTabPlacement(m_place); | 197 | *m_screen.getTabPlacementResource() = m_place; |
198 | FbTk::RadioMenuItem::click(button, time, mods); | 198 | FbTk::RadioMenuItem::click(button, time, mods); |
199 | } | 199 | } |
200 | 200 | ||
@@ -1604,7 +1604,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1604 | tabplacement_menu->insert(p.label); | 1604 | tabplacement_menu->insert(p.label); |
1605 | tabplacement_menu->setItemEnabled(i, false); | 1605 | tabplacement_menu->setItemEnabled(i, false); |
1606 | } else | 1606 | } else |
1607 | tabplacement_menu->insert(new TabPlacementMenuItem(p.label, *this, p.placement, save_and_reconftabs)); | 1607 | tabplacement_menu->insert(new TabPlacementMenuItem(p.label, *this, p.placement, saverc_cmd)); |
1608 | } | 1608 | } |
1609 | tabplacement_menu->updateMenu(); | 1609 | tabplacement_menu->updateMenu(); |
1610 | 1610 | ||
diff --git a/src/Screen.hh b/src/Screen.hh index c524a91..98c13e4 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -88,6 +88,10 @@ public: | |||
88 | typedef std::vector<std::string> WorkspaceNames; | 88 | typedef std::vector<std::string> WorkspaceNames; |
89 | typedef std::list<std::pair<FbTk::FbString, FbTk::RefCount<FbTk::Menu> > > ExtraMenus; | 89 | typedef std::list<std::pair<FbTk::FbString, FbTk::RefCount<FbTk::Menu> > > ExtraMenus; |
90 | 90 | ||
91 | typedef FbTk::Resource< | ||
92 | FbWinFrame::TabPlacement, FbTk::EnumTraits<FbWinFrame::TabPlacement> | ||
93 | > TabPlacementResource; | ||
94 | |||
91 | BScreen(FbTk::ResourceManager_base &rm, | 95 | BScreen(FbTk::ResourceManager_base &rm, |
92 | const std::string &screenname, | 96 | const std::string &screenname, |
93 | int scrn, int number_of_layers); | 97 | int scrn, int number_of_layers); |
@@ -119,7 +123,7 @@ public: | |||
119 | ExtraMenus &extraWindowMenus() { return m_extramenus; } | 123 | ExtraMenus &extraWindowMenus() { return m_extramenus; } |
120 | const ExtraMenus &extraWindowMenus() const { return m_extramenus; } | 124 | const ExtraMenus &extraWindowMenus() const { return m_extramenus; } |
121 | 125 | ||
122 | FbWinFrame::TabPlacement getTabPlacement() const { return *resource.tab_placement; } | 126 | TabPlacementResource &getTabPlacementResource() { return resource.tab_placement; } |
123 | 127 | ||
124 | unsigned int noFocusWhileTypingDelay() const { return *resource.typing_delay; } | 128 | unsigned int noFocusWhileTypingDelay() const { return *resource.typing_delay; } |
125 | const bool allowRemoteActions() const { return *resource.allow_remote_actions; } | 129 | const bool allowRemoteActions() const { return *resource.allow_remote_actions; } |
@@ -252,8 +256,6 @@ public: | |||
252 | 256 | ||
253 | void setRootColormapInstalled(bool r) { root_colormap_installed = r; } | 257 | void setRootColormapInstalled(bool r) { root_colormap_installed = r; } |
254 | 258 | ||
255 | void saveTabPlacement(FbWinFrame::TabPlacement place) { *resource.tab_placement = place; } | ||
256 | |||
257 | void saveWorkspaces(int w) { *resource.workspaces = w; } | 259 | void saveWorkspaces(int w) { *resource.workspaces = w; } |
258 | 260 | ||
259 | FbTk::ThemeProxy<FbWinFrameTheme> &focusedWinFrameTheme() { return *m_focused_windowtheme.get(); } | 261 | FbTk::ThemeProxy<FbWinFrameTheme> &focusedWinFrameTheme() { return *m_focused_windowtheme.get(); } |
@@ -515,7 +517,7 @@ private: | |||
515 | max_ignore_inc, max_disable_move, max_disable_resize, | 517 | max_ignore_inc, max_disable_move, max_disable_resize, |
516 | workspace_warping, show_window_pos, auto_raise, click_raises; | 518 | workspace_warping, show_window_pos, auto_raise, click_raises; |
517 | FbTk::StringResource default_deco; | 519 | FbTk::StringResource default_deco; |
518 | FbTk::Resource<FbWinFrame::TabPlacement, FbTk::EnumTraits<FbWinFrame::TabPlacement> > tab_placement; | 520 | TabPlacementResource tab_placement; |
519 | FbTk::StringResource windowmenufile; | 521 | FbTk::StringResource windowmenufile; |
520 | FbTk::UIntResource typing_delay; | 522 | FbTk::UIntResource typing_delay; |
521 | FbTk::IntResource workspaces, edge_snap_threshold, focused_alpha, | 523 | FbTk::IntResource workspaces, edge_snap_threshold, focused_alpha, |
diff --git a/src/Window.cc b/src/Window.cc index d82a0b1..0bb0f8f 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -431,6 +431,8 @@ void FluxboxWindow::init() { | |||
431 | 431 | ||
432 | join(screen().getDefaultInternalTabsResource().modifiedSig(), | 432 | join(screen().getDefaultInternalTabsResource().modifiedSig(), |
433 | FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); | 433 | FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); |
434 | join(screen().getTabPlacementResource().modifiedSig(), | ||
435 | FbTk::MemFunIgnoreArgs(*this, &FluxboxWindow::applyDecorations)); | ||
434 | 436 | ||
435 | /**************************************************/ | 437 | /**************************************************/ |
436 | /* Read state above here, apply state below here. */ | 438 | /* Read state above here, apply state below here. */ |