aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-20 15:42:00 (GMT)
committerPaul Tagliamonte <paultag@fluxbox.org>2012-04-07 02:11:32 (GMT)
commit3ffe5235a45cf4ecfd570e014423bf8375b17996 (patch)
tree2b0774f85894cfdb718ce50e79d96ef2714da72f /src
parent4f37ab0b981f7e7d12852ad5aec9fd5c540b2a14 (diff)
downloadfluxbox_paul-3ffe5235a45cf4ecfd570e014423bf8375b17996.zip
fluxbox_paul-3ffe5235a45cf4ecfd570e014423bf8375b17996.tar.bz2
Attach modifiedSig handlers to the session.screenX.tab.placement resource
Diffstat (limited to 'src')
-rw-r--r--src/FbWinFrame.cc20
-rw-r--r--src/Screen.cc6
-rw-r--r--src/Screen.hh10
-rw-r--r--src/Window.cc2
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 5e88210..7b57535 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
@@ -1653,7 +1653,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1653 tabplacement_menu->insert(p.label); 1653 tabplacement_menu->insert(p.label);
1654 tabplacement_menu->setItemEnabled(i, false); 1654 tabplacement_menu->setItemEnabled(i, false);
1655 } else 1655 } else
1656 tabplacement_menu->insert(new TabPlacementMenuItem(p.label, *this, p.placement, save_and_reconftabs)); 1656 tabplacement_menu->insert(new TabPlacementMenuItem(p.label, *this, p.placement, saverc_cmd));
1657 } 1657 }
1658 tabplacement_menu->updateMenu(); 1658 tabplacement_menu->updateMenu();
1659 1659
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 200a462..669e40d 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. */