diff options
-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 1c34efd..9acccaf 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -244,13 +244,13 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int heigh | |||
244 | m_state.saveGeometry(window().x(), window().y(), | 244 | m_state.saveGeometry(window().x(), window().y(), |
245 | window().width(), window().height()); | 245 | window().width(), window().height()); |
246 | 246 | ||
247 | if (move || (resize && m_screen.getTabPlacement() != TOPLEFT && | 247 | if (move || (resize && *m_screen.getTabPlacementResource() != TOPLEFT && |
248 | m_screen.getTabPlacement() != LEFTTOP)) | 248 | *m_screen.getTabPlacementResource() != LEFTTOP)) |
249 | alignTabs(); | 249 | alignTabs(); |
250 | 250 | ||
251 | if (resize) { | 251 | if (resize) { |
252 | if (m_tabmode == EXTERNAL) { | 252 | if (m_tabmode == EXTERNAL) { |
253 | switch(m_screen.getTabPlacement()) { | 253 | switch(*m_screen.getTabPlacementResource()) { |
254 | case LEFTTOP: | 254 | case LEFTTOP: |
255 | case RIGHTTOP: | 255 | case RIGHTTOP: |
256 | case LEFT: | 256 | case LEFT: |
@@ -275,7 +275,7 @@ void FbWinFrame::quietMoveResize(int x, int y, | |||
275 | window().width(), window().height()); | 275 | window().width(), window().height()); |
276 | if (m_tabmode == EXTERNAL) { | 276 | if (m_tabmode == EXTERNAL) { |
277 | 277 | ||
278 | switch(m_screen.getTabPlacement()) { | 278 | switch(*m_screen.getTabPlacementResource()) { |
279 | case LEFTTOP: | 279 | case LEFTTOP: |
280 | case RIGHTTOP: | 280 | case RIGHTTOP: |
281 | case LEFT: | 281 | case LEFT: |
@@ -304,7 +304,7 @@ void FbWinFrame::alignTabs() { | |||
304 | m_tab_container.setMaxSizePerClient(m_screen.getTabWidth()); | 304 | m_tab_container.setMaxSizePerClient(m_screen.getTabWidth()); |
305 | 305 | ||
306 | int tabx = 0, taby = 0; | 306 | int tabx = 0, taby = 0; |
307 | switch (m_screen.getTabPlacement()) { | 307 | switch (*m_screen.getTabPlacementResource()) { |
308 | case TOPLEFT: | 308 | case TOPLEFT: |
309 | if (orig_orient != FbTk::ROT0) m_tab_container.hide(); | 309 | if (orig_orient != FbTk::ROT0) m_tab_container.hide(); |
310 | m_tab_container.setOrientation(FbTk::ROT0); | 310 | m_tab_container.setOrientation(FbTk::ROT0); |
@@ -894,7 +894,7 @@ void FbWinFrame::reconfigure() { | |||
894 | 894 | ||
895 | if (m_tabmode == EXTERNAL) { | 895 | if (m_tabmode == EXTERNAL) { |
896 | unsigned int neww, newh; | 896 | unsigned int neww, newh; |
897 | switch (m_screen.getTabPlacement()) { | 897 | switch (*m_screen.getTabPlacementResource()) { |
898 | case TOPLEFT: | 898 | case TOPLEFT: |
899 | case TOP: | 899 | case TOP: |
900 | case TOPRIGHT: | 900 | case TOPRIGHT: |
@@ -1624,7 +1624,7 @@ int FbWinFrame::widthOffset() const { | |||
1624 | return 0; | 1624 | return 0; |
1625 | 1625 | ||
1626 | // same height offset for top and bottom tabs | 1626 | // same height offset for top and bottom tabs |
1627 | switch (m_screen.getTabPlacement()) { | 1627 | switch (*m_screen.getTabPlacementResource()) { |
1628 | case LEFTTOP: | 1628 | case LEFTTOP: |
1629 | case RIGHTTOP: | 1629 | case RIGHTTOP: |
1630 | case LEFT: | 1630 | case LEFT: |
@@ -1643,7 +1643,7 @@ int FbWinFrame::heightOffset() const { | |||
1643 | if (m_tabmode != EXTERNAL || !m_use_tabs) | 1643 | if (m_tabmode != EXTERNAL || !m_use_tabs) |
1644 | return 0; | 1644 | return 0; |
1645 | 1645 | ||
1646 | switch (m_screen.getTabPlacement()) { | 1646 | switch (*m_screen.getTabPlacementResource()) { |
1647 | case TOPLEFT: | 1647 | case TOPLEFT: |
1648 | case TOP: | 1648 | case TOP: |
1649 | case TOPRIGHT: | 1649 | case TOPRIGHT: |
@@ -1662,7 +1662,7 @@ int FbWinFrame::xOffset() 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 LEFTTOP: | 1666 | case LEFTTOP: |
1667 | case LEFT: | 1667 | case LEFT: |
1668 | case LEFTBOTTOM: | 1668 | case LEFTBOTTOM: |
@@ -1678,7 +1678,7 @@ int FbWinFrame::yOffset() 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 TOPLEFT: | 1682 | case TOPLEFT: |
1683 | case TOP: | 1683 | case TOP: |
1684 | case TOPRIGHT: | 1684 | 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 c97b0a3..d1edade 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. */ |