diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2013-02-06 12:47:11 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2013-02-06 12:47:17 (GMT) |
commit | 34343bb20bdb3dc94fe426f69e5db16315353d57 (patch) | |
tree | cbf01e0b2af4ca14c093ada589f82558ec7d3a66 /src/Window.cc | |
parent | 94fddc09c064555721dc521e3e94ed6f610653b9 (diff) | |
download | fluxbox-34343bb20bdb3dc94fe426f69e5db16315353d57.zip fluxbox-34343bb20bdb3dc94fe426f69e5db16315353d57.tar.bz2 |
Feature #3602124: 'LHalf' and 'RHalf' buttons to the titlebar
First draft of feature request of #3602124: Having 2 buttons in the titlebar
which allow quick positioning of a Window into the left or right half of the
current monitor.
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Window.cc b/src/Window.cc index 1ee8853..98486be 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -48,6 +48,7 @@ | |||
48 | 48 | ||
49 | #include "FbTk/StringUtil.hh" | 49 | #include "FbTk/StringUtil.hh" |
50 | #include "FbTk/Compose.hh" | 50 | #include "FbTk/Compose.hh" |
51 | #include "FbTk/CommandParser.hh" | ||
51 | #include "FbTk/EventManager.hh" | 52 | #include "FbTk/EventManager.hh" |
52 | #include "FbTk/KeyUtil.hh" | 53 | #include "FbTk/KeyUtil.hh" |
53 | #include "FbTk/SimpleCommand.hh" | 54 | #include "FbTk/SimpleCommand.hh" |
@@ -3600,6 +3601,32 @@ void FluxboxWindow::updateButtons() { | |||
3600 | winbtn->setOnClick(show_menu_cmd); | 3601 | winbtn->setOnClick(show_menu_cmd); |
3601 | } | 3602 | } |
3602 | break; | 3603 | break; |
3604 | |||
3605 | case WinButton::LEFT_HALF: | ||
3606 | { | ||
3607 | winbtn = new WinButton(*this, m_button_theme, | ||
3608 | screen().pressedWinButtonTheme(), | ||
3609 | dir[i], | ||
3610 | frame().titlebar(), | ||
3611 | 0, 0, 10, 10); | ||
3612 | |||
3613 | CommandRef lhalf_cmd(FbTk::CommandParser<void>::instance().parse("MacroCmd {MoveTo 0 0} {ResizeTo 50% 100%}")); | ||
3614 | winbtn->setOnClick(lhalf_cmd); | ||
3615 | } | ||
3616 | break; | ||
3617 | |||
3618 | case WinButton::RIGHT_HALF: | ||
3619 | { | ||
3620 | winbtn = new WinButton(*this, m_button_theme, | ||
3621 | screen().pressedWinButtonTheme(), | ||
3622 | dir[i], | ||
3623 | frame().titlebar(), | ||
3624 | 0, 0, 10, 10); | ||
3625 | CommandRef rhalf_cmd(FbTk::CommandParser<void>::instance().parse("MacroCmd {MoveTo 50% 0} {ResizeTo 50% 100%}")); | ||
3626 | winbtn->setOnClick(rhalf_cmd); | ||
3627 | } | ||
3628 | break; | ||
3629 | |||
3603 | } | 3630 | } |
3604 | 3631 | ||
3605 | 3632 | ||