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 99dd93d..68adc0f 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -525,7 +525,7 @@ void FbWinFrame::setFocus(bool newvalue) {
525 if (newvalue) // focused 525 if (newvalue) // focused
526 applyFocusLabel(*m_current_label); 526 applyFocusLabel(*m_current_label);
527 else // unfocused 527 else // unfocused
528 applyActiveLabel(*m_current_label); 528 applyUnfocusLabel(*m_current_label);
529 } 529 }
530 530
531 applyAll(); 531 applyAll();
@@ -711,7 +711,7 @@ void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn) {
711 if (m_focused) 711 if (m_focused)
712 applyFocusLabel(*m_current_label); 712 applyFocusLabel(*m_current_label);
713 else 713 else
714 applyActiveLabel(*m_current_label); 714 applyUnfocusLabel(*m_current_label);
715} 715}
716 716
717void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn, bool value) { 717void FbWinFrame::setLabelButtonFocus(FbTk::TextButton &btn, bool value) {
@@ -1320,10 +1320,6 @@ void FbWinFrame::renderTabContainer() {
1320 m_labelbutton_unfocused_pm, 1320 m_labelbutton_unfocused_pm,
1321 m_tab_container.width(), m_tab_container.height(), m_tab_container.orientation()); 1321 m_tab_container.width(), m_tab_container.height(), m_tab_container.orientation());
1322 1322
1323 render(m_theme.labelActiveTexture(), m_labelbutton_active_color,
1324 m_labelbutton_active_pm,
1325 m_tab_container.width(), m_tab_container.height(), m_tab_container.orientation());
1326
1327 renderButtons(); 1323 renderButtons();
1328 1324
1329} 1325}
@@ -1473,7 +1469,7 @@ void FbWinFrame::init() {
1473 m_title_focused_pm = m_title_unfocused_pm = 0; 1469 m_title_focused_pm = m_title_unfocused_pm = 0;
1474 m_label_focused_pm = m_label_unfocused_pm = 0; 1470 m_label_focused_pm = m_label_unfocused_pm = 0;
1475 m_tabcontainer_focused_pm = m_tabcontainer_unfocused_pm = 0; 1471 m_tabcontainer_focused_pm = m_tabcontainer_unfocused_pm = 0;
1476 m_labelbutton_focused_pm = m_labelbutton_unfocused_pm = m_labelbutton_active_pm = 0; 1472 m_labelbutton_focused_pm = m_labelbutton_unfocused_pm = 0;
1477 m_handle_focused_pm = m_handle_unfocused_pm = 0; 1473 m_handle_focused_pm = m_handle_unfocused_pm = 0;
1478 m_button_pm = m_button_unfocused_pm = m_button_pressed_pm = 0; 1474 m_button_pm = m_button_unfocused_pm = m_button_pressed_pm = 0;
1479 m_grip_unfocused_pm = m_grip_focused_pm = 0; 1475 m_grip_unfocused_pm = m_grip_focused_pm = 0;
@@ -1597,12 +1593,9 @@ void FbWinFrame::applyTabContainer() {
1597 Container::ItemList::iterator btn_it_end = m_tab_container.end(); 1593 Container::ItemList::iterator btn_it_end = m_tab_container.end();
1598 for (; btn_it != btn_it_end; ++btn_it) { 1594 for (; btn_it != btn_it_end; ++btn_it) {
1599 FbTk::TextButton *btn = static_cast<FbTk::TextButton *>(*btn_it); 1595 FbTk::TextButton *btn = static_cast<FbTk::TextButton *>(*btn_it);
1600 if (btn == m_current_label) { 1596 if (btn == m_current_label && m_focused)
1601 if (m_focused) 1597 applyFocusLabel(*btn);
1602 applyFocusLabel(*btn); 1598 else
1603 else
1604 applyActiveLabel(*btn);
1605 } else
1606 applyUnfocusLabel(*btn); 1599 applyUnfocusLabel(*btn);
1607 } 1600 }
1608} 1601}
@@ -1674,19 +1667,6 @@ void FbWinFrame::applyFocusLabel(FbTk::TextButton &button) {
1674 1667
1675} 1668}
1676 1669
1677void FbWinFrame::applyActiveLabel(FbTk::TextButton &button) {
1678
1679 button.setGC(theme().labelTextActiveGC());
1680 button.setJustify(theme().justify());
1681 button.setAlpha(getAlpha(m_focused));
1682
1683 if (m_labelbutton_active_pm != 0) {
1684 button.setBackgroundPixmap(m_labelbutton_active_pm);
1685 } else
1686 button.setBackgroundColor(m_labelbutton_active_color);
1687
1688}
1689
1690void FbWinFrame::applyUnfocusLabel(FbTk::TextButton &button) { 1670void FbWinFrame::applyUnfocusLabel(FbTk::TextButton &button) {
1691 1671
1692 button.setGC(theme().labelTextUnfocusGC()); 1672 button.setGC(theme().labelTextUnfocusGC());
@@ -1700,27 +1680,6 @@ void FbWinFrame::applyUnfocusLabel(FbTk::TextButton &button) {
1700 1680
1701} 1681}
1702 1682
1703namespace {
1704class IgnoreEvent {
1705public:
1706 typedef void result_type;
1707 typedef Window argument_type;
1708 explicit IgnoreEvent(long eventmask):
1709 m_display(FbTk::App::instance()->display()),
1710 m_event_mask(eventmask) {
1711 }
1712
1713 void operator()(Window win) const {
1714 static XEvent event;
1715 while (XCheckWindowEvent(m_display, win, m_event_mask, &event))
1716 continue;
1717 }
1718private:
1719 Display *m_display;
1720 long m_event_mask;
1721};
1722}
1723
1724// this function translates its arguments according to win_gravity 1683// this function translates its arguments according to win_gravity
1725// if win_gravity is negative, it does an inverse translation 1684// if win_gravity is negative, it does an inverse translation
1726// This function should be used when a window is mapped/unmapped/pos configured 1685// This function should be used when a window is mapped/unmapped/pos configured