aboutsummaryrefslogtreecommitdiff
path: root/src/FbWinFrame.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r--src/FbWinFrame.cc53
1 files changed, 6 insertions, 47 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 84f47f4..124883e 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -526,7 +526,7 @@ void FbWinFrame::setFocus(bool newvalue) {
526 if (newvalue) // focused 526 if (newvalue) // focused
527 applyFocusLabel(*m_current_label); 527 applyFocusLabel(*m_current_label);
528 else // unfocused 528 else // unfocused
529 applyActiveLabel(*m_current_label); 529 applyUnfocusLabel(*m_current_label);
530 } 530 }
531 531
532 applyAll(); 532 applyAll();
@@ -706,7 +706,7 @@ void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn) {
706 if (m_focused) 706 if (m_focused)
707 applyFocusLabel(*m_current_label); 707 applyFocusLabel(*m_current_label);
708 else 708 else
709 applyActiveLabel(*m_current_label); 709 applyUnfocusLabel(*m_current_label);
710} 710}
711 711
712void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn, bool value) { 712void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn, bool value) {
@@ -1315,10 +1315,6 @@ void FbWinFrame::renderTabContainer() {
1315 m_labelbutton_unfocused_pm, 1315 m_labelbutton_unfocused_pm,
1316 m_tab_container.width(), m_tab_container.height(), m_tab_container.orientation()); 1316 m_tab_container.width(), m_tab_container.height(), m_tab_container.orientation());
1317 1317
1318 render(m_theme.labelActiveTexture(), m_labelbutton_active_color,
1319 m_labelbutton_active_pm,
1320 m_tab_container.width(), m_tab_container.height(), m_tab_container.orientation());
1321
1322 renderButtons(); 1318 renderButtons();
1323 1319
1324} 1320}
@@ -1468,7 +1464,7 @@ void FbWinFrame::init() {
1468 m_title_focused_pm = m_title_unfocused_pm = 0; 1464 m_title_focused_pm = m_title_unfocused_pm = 0;
1469 m_label_focused_pm = m_label_unfocused_pm = 0; 1465 m_label_focused_pm = m_label_unfocused_pm = 0;
1470 m_tabcontainer_focused_pm = m_tabcontainer_unfocused_pm = 0; 1466 m_tabcontainer_focused_pm = m_tabcontainer_unfocused_pm = 0;
1471 m_labelbutton_focused_pm = m_labelbutton_unfocused_pm = m_labelbutton_active_pm = 0; 1467 m_labelbutton_focused_pm = m_labelbutton_unfocused_pm = 0;
1472 m_handle_focused_pm = m_handle_unfocused_pm = 0; 1468 m_handle_focused_pm = m_handle_unfocused_pm = 0;
1473 m_button_pm = m_button_unfocused_pm = m_button_pressed_pm = 0; 1469 m_button_pm = m_button_unfocused_pm = m_button_pressed_pm = 0;
1474 m_grip_unfocused_pm = m_grip_focused_pm = 0; 1470 m_grip_unfocused_pm = m_grip_focused_pm = 0;
@@ -1592,12 +1588,9 @@ void FbWinFrame::applyTabContainer() {
1592 Container::ItemList::iterator btn_it_end = m_tab_container.end(); 1588 Container::ItemList::iterator btn_it_end = m_tab_container.end();
1593 for (; btn_it != btn_it_end; ++btn_it) { 1589 for (; btn_it != btn_it_end; ++btn_it) {
1594 FbTk::TextButton *btn = static_cast<FbTk::TextButton *>(*btn_it); 1590 FbTk::TextButton *btn = static_cast<FbTk::TextButton *>(*btn_it);
1595 if (btn == m_current_label) { 1591 if (btn == m_current_label && m_focused)
1596 if (m_focused) 1592 applyFocusLabel(*btn);
1597 applyFocusLabel(*btn); 1593 else
1598 else
1599 applyActiveLabel(*btn);
1600 } else
1601 applyUnfocusLabel(*btn); 1594 applyUnfocusLabel(*btn);
1602 } 1595 }
1603} 1596}
@@ -1669,19 +1662,6 @@ void FbWinFrame::applyFocusLabel(FbTk::TextButton &button) {
1669 1662
1670} 1663}
1671 1664
1672void FbWinFrame::applyActiveLabel(FbTk::TextButton &button) {
1673
1674 button.setGC(theme().labelTextActiveGC());
1675 button.setJustify(theme().justify());
1676 button.setAlpha(getAlpha(m_focused));
1677
1678 if (m_labelbutton_active_pm != 0) {
1679 button.setBackgroundPixmap(m_labelbutton_active_pm);
1680 } else
1681 button.setBackgroundColor(m_labelbutton_active_color);
1682
1683}
1684
1685void FbWinFrame::applyUnfocusLabel(FbTk::TextButton &button) { 1665void FbWinFrame::applyUnfocusLabel(FbTk::TextButton &button) {
1686 1666
1687 button.setGC(theme().labelTextUnfocusGC()); 1667 button.setGC(theme().labelTextUnfocusGC());
@@ -1695,27 +1675,6 @@ void FbWinFrame::applyUnfocusLabel(FbTk::TextButton &button) {
1695 1675
1696} 1676}
1697 1677
1698namespace {
1699class IgnoreEvent {
1700public:
1701 typedef void result_type;
1702 typedef Window argument_type;
1703 explicit IgnoreEvent(long eventmask):
1704 m_display(FbTk::App::instance()->display()),
1705 m_event_mask(eventmask) {
1706 }
1707
1708 void operator()(Window win) const {
1709 static XEvent event;
1710 while (XCheckWindowEvent(m_display, win, m_event_mask, &event))
1711 continue;
1712 }
1713private:
1714 Display *m_display;
1715 long m_event_mask;
1716};
1717}
1718
1719// this function translates its arguments according to win_gravity 1678// this function translates its arguments according to win_gravity
1720// if win_gravity is negative, it does an inverse translation 1679// if win_gravity is negative, it does an inverse translation
1721// This function should be used when a window is mapped/unmapped/pos configured 1680// This function should be used when a window is mapped/unmapped/pos configured