diff options
Diffstat (limited to 'src/Screen.cc')
-rw-r--r-- | src/Screen.cc | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index e504a9b..250857b 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -184,9 +184,8 @@ int calcSquareDistance(int x1, int y1, int x2, int y2) { | |||
184 | class TabPlacementMenuItem: public FbTk::RadioMenuItem { | 184 | class TabPlacementMenuItem: public FbTk::RadioMenuItem { |
185 | public: | 185 | public: |
186 | TabPlacementMenuItem(const FbTk::FbString & label, BScreen &screen, | 186 | TabPlacementMenuItem(const FbTk::FbString & label, BScreen &screen, |
187 | FbWinFrame::TabPlacement place, | 187 | FbWinFrame::TabPlacement place): |
188 | FbTk::RefCount<FbTk::Command<void> > &cmd): | 188 | FbTk::RadioMenuItem(label), |
189 | FbTk::RadioMenuItem(label, cmd), | ||
190 | m_screen(screen), | 189 | m_screen(screen), |
191 | m_place(place) { | 190 | m_place(place) { |
192 | setCloseOnClick(false); | 191 | setCloseOnClick(false); |
@@ -1491,15 +1490,8 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1491 | 1490 | ||
1492 | menu.removeAll(); | 1491 | menu.removeAll(); |
1493 | 1492 | ||
1494 | FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand(); | ||
1495 | FbTk::RefCount<FbTk::Command<void> > saverc_cmd(new FbTk::SimpleCommand<Fluxbox>( | ||
1496 | *Fluxbox::instance(), | ||
1497 | &Fluxbox::save_rc)); | ||
1498 | FbTk::RefCount<FbTk::Command<void> > reconf_cmd(FbTk::CommandParser<void>::instance().parse("reconfigure")); | 1493 | FbTk::RefCount<FbTk::Command<void> > reconf_cmd(FbTk::CommandParser<void>::instance().parse("reconfigure")); |
1499 | 1494 | ||
1500 | s_a_reconf_macro->add(saverc_cmd); | ||
1501 | s_a_reconf_macro->add(reconf_cmd); | ||
1502 | FbTk::RefCount<FbTk::Command<void> > save_and_reconfigure(s_a_reconf_macro); | ||
1503 | // create focus menu | 1495 | // create focus menu |
1504 | // we don't set this to internal menu so will | 1496 | // we don't set this to internal menu so will |
1505 | // be deleted toghether with the parent | 1497 | // be deleted toghether with the parent |
@@ -1508,12 +1500,12 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1508 | "Method used to give focus to windows"); | 1500 | "Method used to give focus to windows"); |
1509 | FbTk::RefCount<FbTk::Menu> focus_menu( createMenu(focusmenu_label) ); | 1501 | FbTk::RefCount<FbTk::Menu> focus_menu( createMenu(focusmenu_label) ); |
1510 | 1502 | ||
1511 | #define _BOOLITEM(m,a, b, c, d, e, f) (m).insert(new FbTk::BoolMenuItem(_FB_XTEXT(a, b, c, d), e, f)) | 1503 | #define _BOOLITEM(m,a, b, c, d, e) (m).insert(new FbTk::BoolMenuItem(_FB_XTEXT(a, b, c, d), e)) |
1512 | 1504 | ||
1513 | 1505 | ||
1514 | #define _FOCUSITEM(a, b, c, d, e) \ | 1506 | #define _FOCUSITEM(a, b, c, d, e) \ |
1515 | focus_menu->insert(new FocusModelMenuItem(_FB_XTEXT(a, b, c, d), focusControl(), \ | 1507 | focus_menu->insert(new FocusModelMenuItem(_FB_XTEXT(a, b, c, d), focusControl(), \ |
1516 | e, save_and_reconfigure)) | 1508 | e, reconf_cmd)) |
1517 | 1509 | ||
1518 | _FOCUSITEM(Configmenu, ClickFocus, | 1510 | _FOCUSITEM(Configmenu, ClickFocus, |
1519 | "Click To Focus", "Click to focus", | 1511 | "Click To Focus", "Click to focus", |
@@ -1531,10 +1523,10 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1531 | focus_menu->insert(new FbTk::MenuSeparator()); | 1523 | focus_menu->insert(new FbTk::MenuSeparator()); |
1532 | focus_menu->insert(new TabFocusModelMenuItem(_FB_XTEXT(Configmenu, | 1524 | focus_menu->insert(new TabFocusModelMenuItem(_FB_XTEXT(Configmenu, |
1533 | ClickTabFocus, "ClickTabFocus", "Click tab to focus windows"), | 1525 | ClickTabFocus, "ClickTabFocus", "Click tab to focus windows"), |
1534 | focusControl(), FocusControl::CLICKTABFOCUS, save_and_reconfigure)); | 1526 | focusControl(), FocusControl::CLICKTABFOCUS, reconf_cmd)); |
1535 | focus_menu->insert(new TabFocusModelMenuItem(_FB_XTEXT(Configmenu, | 1527 | focus_menu->insert(new TabFocusModelMenuItem(_FB_XTEXT(Configmenu, |
1536 | MouseTabFocus, "MouseTabFocus", "Hover over tab to focus windows"), | 1528 | MouseTabFocus, "MouseTabFocus", "Hover over tab to focus windows"), |
1537 | focusControl(), FocusControl::MOUSETABFOCUS, save_and_reconfigure)); | 1529 | focusControl(), FocusControl::MOUSETABFOCUS, reconf_cmd)); |
1538 | focus_menu->insert(new FbTk::MenuSeparator()); | 1530 | focus_menu->insert(new FbTk::MenuSeparator()); |
1539 | 1531 | ||
1540 | try { | 1532 | try { |
@@ -1548,10 +1540,10 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1548 | 1540 | ||
1549 | _BOOLITEM(*focus_menu, Configmenu, AutoRaise, | 1541 | _BOOLITEM(*focus_menu, Configmenu, AutoRaise, |
1550 | "Auto Raise", "Auto Raise windows on sloppy", | 1542 | "Auto Raise", "Auto Raise windows on sloppy", |
1551 | resource.auto_raise, saverc_cmd); | 1543 | resource.auto_raise); |
1552 | _BOOLITEM(*focus_menu, Configmenu, ClickRaises, | 1544 | _BOOLITEM(*focus_menu, Configmenu, ClickRaises, |
1553 | "Click Raises", "Click Raises", | 1545 | "Click Raises", "Click Raises", |
1554 | resource.click_raises, saverc_cmd); | 1546 | resource.click_raises); |
1555 | 1547 | ||
1556 | focus_menu->updateMenu(); | 1548 | focus_menu->updateMenu(); |
1557 | 1549 | ||
@@ -1567,17 +1559,17 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1567 | 1559 | ||
1568 | _BOOLITEM(*maxmenu, Configmenu, FullMax, | 1560 | _BOOLITEM(*maxmenu, Configmenu, FullMax, |
1569 | "Full Maximization", "Maximise over slit, toolbar, etc", | 1561 | "Full Maximization", "Maximise over slit, toolbar, etc", |
1570 | resource.full_max, saverc_cmd); | 1562 | resource.full_max); |
1571 | _BOOLITEM(*maxmenu, Configmenu, MaxIgnoreInc, | 1563 | _BOOLITEM(*maxmenu, Configmenu, MaxIgnoreInc, |
1572 | "Ignore Resize Increment", | 1564 | "Ignore Resize Increment", |
1573 | "Maximizing Ignores Resize Increment (e.g. xterm)", | 1565 | "Maximizing Ignores Resize Increment (e.g. xterm)", |
1574 | resource.max_ignore_inc, saverc_cmd); | 1566 | resource.max_ignore_inc); |
1575 | _BOOLITEM(*maxmenu, Configmenu, MaxDisableMove, | 1567 | _BOOLITEM(*maxmenu, Configmenu, MaxDisableMove, |
1576 | "Disable Moving", "Don't Allow Moving While Maximized", | 1568 | "Disable Moving", "Don't Allow Moving While Maximized", |
1577 | resource.max_disable_move, saverc_cmd); | 1569 | resource.max_disable_move); |
1578 | _BOOLITEM(*maxmenu, Configmenu, MaxDisableResize, | 1570 | _BOOLITEM(*maxmenu, Configmenu, MaxDisableResize, |
1579 | "Disable Resizing", "Don't Allow Resizing While Maximized", | 1571 | "Disable Resizing", "Don't Allow Resizing While Maximized", |
1580 | resource.max_disable_resize, saverc_cmd); | 1572 | resource.max_disable_resize); |
1581 | 1573 | ||
1582 | maxmenu->updateMenu(); | 1574 | maxmenu->updateMenu(); |
1583 | menu.insert(maxmenu_label, maxmenu); | 1575 | menu.insert(maxmenu_label, maxmenu); |
@@ -1597,13 +1589,13 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1597 | 1589 | ||
1598 | _BOOLITEM(*tab_menu,Configmenu, TabsInTitlebar, | 1590 | _BOOLITEM(*tab_menu,Configmenu, TabsInTitlebar, |
1599 | "Tabs in Titlebar", "Tabs in Titlebar", | 1591 | "Tabs in Titlebar", "Tabs in Titlebar", |
1600 | resource.default_internal_tabs, saverc_cmd); | 1592 | resource.default_internal_tabs); |
1601 | tab_menu->insert(new FbTk::BoolMenuItem(_FB_XTEXT(Common, MaximizeOver, | 1593 | tab_menu->insert(new FbTk::BoolMenuItem(_FB_XTEXT(Common, MaximizeOver, |
1602 | "Maximize Over", "Maximize over this thing when maximizing"), | 1594 | "Maximize Over", "Maximize over this thing when maximizing"), |
1603 | resource.max_over_tabs, save_and_reconfigure)); | 1595 | resource.max_over_tabs, reconf_cmd)); |
1604 | tab_menu->insert(new FbTk::BoolMenuItem(_FB_XTEXT(Toolbar, ShowIcons, | 1596 | tab_menu->insert(new FbTk::BoolMenuItem(_FB_XTEXT(Toolbar, ShowIcons, |
1605 | "Show Pictures", "chooses if little icons are shown next to title in the iconbar"), | 1597 | "Show Pictures", "chooses if little icons are shown next to title in the iconbar"), |
1606 | resource.tabs_use_pixmap, save_and_reconfigure)); | 1598 | resource.tabs_use_pixmap, reconf_cmd)); |
1607 | 1599 | ||
1608 | FbTk::MenuItem *tab_width_item = | 1600 | FbTk::MenuItem *tab_width_item = |
1609 | new FbTk::IntMenuItem(_FB_XTEXT(Configmenu, ExternalTabWidth, | 1601 | new FbTk::IntMenuItem(_FB_XTEXT(Configmenu, ExternalTabWidth, |
@@ -1611,7 +1603,6 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1611 | "Width of external-style tabs"), | 1603 | "Width of external-style tabs"), |
1612 | resource.tab_width, 10, 3000, /* silly number */ | 1604 | resource.tab_width, 10, 3000, /* silly number */ |
1613 | *tab_menu); | 1605 | *tab_menu); |
1614 | tab_width_item->setCommand(saverc_cmd); | ||
1615 | tab_menu->insert(tab_width_item); | 1606 | tab_menu->insert(tab_width_item); |
1616 | 1607 | ||
1617 | // menu is 3 wide, 5 down | 1608 | // menu is 3 wide, 5 down |
@@ -1646,7 +1637,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1646 | tabplacement_menu->insert(p.label); | 1637 | tabplacement_menu->insert(p.label); |
1647 | tabplacement_menu->setItemEnabled(i, false); | 1638 | tabplacement_menu->setItemEnabled(i, false); |
1648 | } else | 1639 | } else |
1649 | tabplacement_menu->insert(new TabPlacementMenuItem(p.label, *this, p.placement, saverc_cmd)); | 1640 | tabplacement_menu->insert(new TabPlacementMenuItem(p.label, *this, p.placement)); |
1650 | } | 1641 | } |
1651 | tabplacement_menu->updateMenu(); | 1642 | tabplacement_menu->updateMenu(); |
1652 | 1643 | ||
@@ -1665,13 +1656,13 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1665 | alpha_menu->insert(new FbTk::BoolMenuItem(_FB_XTEXT(Configmenu, ForcePseudoTrans, | 1656 | alpha_menu->insert(new FbTk::BoolMenuItem(_FB_XTEXT(Configmenu, ForcePseudoTrans, |
1666 | "Force Pseudo-Transparency", | 1657 | "Force Pseudo-Transparency", |
1667 | "When composite is available, still use old pseudo-transparency"), | 1658 | "When composite is available, still use old pseudo-transparency"), |
1668 | Fluxbox::instance()->getPseudoTransResource(), save_and_reconfigure)); | 1659 | Fluxbox::instance()->getPseudoTransResource(), reconf_cmd)); |
1669 | } | 1660 | } |
1670 | 1661 | ||
1671 | // in order to save system resources, don't save or reconfigure alpha | 1662 | // in order to save system resources, don't save or reconfigure alpha |
1672 | // settings until after the user is done changing them | 1663 | // settings until after the user is done changing them |
1673 | FbTk::RefCount<FbTk::Command<void> > delayed_save_and_reconf( | 1664 | FbTk::RefCount<FbTk::Command<void> > delayed_save_and_reconf( |
1674 | new FbTk::DelayedCmd(save_and_reconfigure)); | 1665 | new FbTk::DelayedCmd(reconf_cmd)); |
1675 | 1666 | ||
1676 | FbTk::MenuItem *focused_alpha_item = | 1667 | FbTk::MenuItem *focused_alpha_item = |
1677 | new FbTk::IntMenuItem(_FB_XTEXT(Configmenu, FocusedAlpha, | 1668 | new FbTk::IntMenuItem(_FB_XTEXT(Configmenu, FocusedAlpha, |
@@ -1711,11 +1702,11 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1711 | _BOOLITEM(menu, Configmenu, OpaqueMove, | 1702 | _BOOLITEM(menu, Configmenu, OpaqueMove, |
1712 | "Opaque Window Moving", | 1703 | "Opaque Window Moving", |
1713 | "Window Moving with whole window visible (as opposed to outline moving)", | 1704 | "Window Moving with whole window visible (as opposed to outline moving)", |
1714 | resource.opaque_move, saverc_cmd); | 1705 | resource.opaque_move); |
1715 | _BOOLITEM(menu, Configmenu, WorkspaceWarping, | 1706 | _BOOLITEM(menu, Configmenu, WorkspaceWarping, |
1716 | "Workspace Warping", | 1707 | "Workspace Warping", |
1717 | "Workspace Warping - dragging windows to the edge and onto the next workspace", | 1708 | "Workspace Warping - dragging windows to the edge and onto the next workspace", |
1718 | resource.workspace_warping, saverc_cmd); | 1709 | resource.workspace_warping); |
1719 | 1710 | ||
1720 | #undef _BOOLITEM | 1711 | #undef _BOOLITEM |
1721 | 1712 | ||