diff options
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r-- | src/FbWinFrame.cc | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 1a98ff5..0fa71d5 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -43,14 +43,12 @@ using std::string; | |||
43 | 43 | ||
44 | FbWinFrame::FbWinFrame(BScreen &screen, | 44 | FbWinFrame::FbWinFrame(BScreen &screen, |
45 | FocusableTheme<FbWinFrameTheme> &theme, | 45 | FocusableTheme<FbWinFrameTheme> &theme, |
46 | FbTk::ImageControl &imgctrl, | 46 | FbTk::XLayer &layer, WindowState &state): |
47 | FbTk::XLayer &layer, | ||
48 | int x, int y, | ||
49 | unsigned int width, unsigned int height): | ||
50 | m_screen(screen), | 47 | m_screen(screen), |
51 | m_theme(theme), | 48 | m_theme(theme), |
52 | m_imagectrl(imgctrl), | 49 | m_imagectrl(screen.imageControl()), |
53 | m_window(theme->screenNum(), x, y, width, height, | 50 | m_state(state), |
51 | m_window(theme->screenNum(), state.x, state.y, state.width, state.height, | ||
54 | ButtonPressMask | ButtonReleaseMask | | 52 | ButtonPressMask | ButtonReleaseMask | |
55 | ButtonMotionMask | EnterWindowMask | | 53 | ButtonMotionMask | EnterWindowMask | |
56 | LeaveWindowMask, true), | 54 | LeaveWindowMask, true), |
@@ -189,19 +187,6 @@ void FbWinFrame::show() { | |||
189 | m_window.show(); | 187 | m_window.show(); |
190 | } | 188 | } |
191 | 189 | ||
192 | /** | ||
193 | Toggle shade state, and resize window | ||
194 | */ | ||
195 | void FbWinFrame::shade() { | ||
196 | if (!(m_state.deco_mask & WindowState::DECORM_TITLEBAR)) | ||
197 | return; | ||
198 | |||
199 | // toggle shade | ||
200 | m_state.shaded = !m_state.shaded; | ||
201 | applyState(); | ||
202 | } | ||
203 | |||
204 | |||
205 | void FbWinFrame::move(int x, int y) { | 190 | void FbWinFrame::move(int x, int y) { |
206 | moveResize(x, y, 0, 0, true, false); | 191 | moveResize(x, y, 0, 0, true, false); |
207 | } | 192 | } |
@@ -519,22 +504,6 @@ void FbWinFrame::setFocus(bool newvalue) { | |||
519 | clearAll(); | 504 | clearAll(); |
520 | } | 505 | } |
521 | 506 | ||
522 | void FbWinFrame::setFullscreen(bool newvalue) { | ||
523 | if (newvalue == m_state.fullscreen) | ||
524 | return; | ||
525 | |||
526 | m_state.fullscreen = newvalue; | ||
527 | applyState(); | ||
528 | } | ||
529 | |||
530 | void FbWinFrame::setMaximized(int value) { | ||
531 | if (value == m_state.maximized) | ||
532 | return; | ||
533 | |||
534 | m_state.maximized = value; | ||
535 | applyState(); | ||
536 | } | ||
537 | |||
538 | void FbWinFrame::applyState() { | 507 | void FbWinFrame::applyState() { |
539 | applyDecorations(); | 508 | applyDecorations(); |
540 | 509 | ||
@@ -542,7 +511,7 @@ void FbWinFrame::applyState() { | |||
542 | int new_x = m_state.x, new_y = m_state.y; | 511 | int new_x = m_state.x, new_y = m_state.y; |
543 | unsigned int new_w = m_state.width, new_h = m_state.height; | 512 | unsigned int new_w = m_state.width, new_h = m_state.height; |
544 | 513 | ||
545 | if (m_state.maximized & WindowState::MAX_VERT) { | 514 | if (m_state.isMaximizedVert()) { |
546 | new_y = m_screen.maxTop(head); | 515 | new_y = m_screen.maxTop(head); |
547 | new_h = m_screen.maxBottom(head) - new_y - 2*window().borderWidth(); | 516 | new_h = m_screen.maxBottom(head) - new_y - 2*window().borderWidth(); |
548 | if (!m_screen.getMaxOverTabs()) { | 517 | if (!m_screen.getMaxOverTabs()) { |
@@ -550,7 +519,7 @@ void FbWinFrame::applyState() { | |||
550 | new_h -= heightOffset(); | 519 | new_h -= heightOffset(); |
551 | } | 520 | } |
552 | } | 521 | } |
553 | if (m_state.maximized & WindowState::MAX_HORZ) { | 522 | if (m_state.isMaximizedHorz()) { |
554 | new_x = m_screen.maxLeft(head); | 523 | new_x = m_screen.maxLeft(head); |
555 | new_w = m_screen.maxRight(head) - new_x - 2*window().borderWidth(); | 524 | new_w = m_screen.maxRight(head) - new_x - 2*window().borderWidth(); |
556 | if (!m_screen.getMaxOverTabs()) { | 525 | if (!m_screen.getMaxOverTabs()) { |