summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbWinFrame.cc71
1 files changed, 32 insertions, 39 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index c4b7150..bd44467 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbWinFrame.cc,v 1.74 2004/01/23 11:04:05 fluxgen Exp $ 22// $Id: FbWinFrame.cc,v 1.75 2004/02/27 12:20:01 fluxgen Exp $
23 23
24#include "FbWinFrame.hh" 24#include "FbWinFrame.hh"
25 25
@@ -27,10 +27,10 @@
27#include "FbTk/EventManager.hh" 27#include "FbTk/EventManager.hh"
28#include "FbTk/TextButton.hh" 28#include "FbTk/TextButton.hh"
29#include "FbTk/App.hh" 29#include "FbTk/App.hh"
30#include "FbTk/Compose.hh"
31#include "FbTk/SimpleCommand.hh" 30#include "FbTk/SimpleCommand.hh"
32 31#include "CompareWindow.hh"
33#include "FbWinFrameTheme.hh" 32#include "FbWinFrameTheme.hh"
33
34#ifdef SHAPE 34#ifdef SHAPE
35#include "Shape.hh" 35#include "Shape.hh"
36#endif // SHAPE 36#endif // SHAPE
@@ -546,8 +546,8 @@ void FbWinFrame::buttonReleaseEvent(XButtonEvent &event) {
546 546
547 LabelList::iterator button_it = find_if(m_labelbuttons.begin(), 547 LabelList::iterator button_it = find_if(m_labelbuttons.begin(),
548 m_labelbuttons.end(), 548 m_labelbuttons.end(),
549 FbTk::Compose(bind2nd(equal_to<Window>(), event.window), 549 CompareWindow(&FbTk::Button::window,
550 mem_fun(&FbTk::Button::window))); 550 event.window));
551 if (button_it != m_labelbuttons.end()) 551 if (button_it != m_labelbuttons.end())
552 (*button_it)->buttonReleaseEvent(event); 552 (*button_it)->buttonReleaseEvent(event);
553 553
@@ -592,11 +592,9 @@ void FbWinFrame::exposeEvent(XExposeEvent &event) {
592 m_grip_right.updateTransparent(event.x, event.y, event.width, event.height); 592 m_grip_right.updateTransparent(event.x, event.y, event.width, event.height);
593 } else { 593 } else {
594 // create compare function 594 // create compare function
595 // that we should use with find_if 595 // that we should use with find_if
596 FbTk::Compose_base<std::binder2nd<std::equal_to<Window> >, 596 FbTk::CompareEqual_base<FbTk::FbWindow, Window> compare(&FbTk::FbWindow::window,
597 std::const_mem_fun_t<Window, FbTk::FbWindow> > 597 event.window);
598 compare = FbTk::Compose(bind2nd(equal_to<Window>(), event.window),
599 mem_fun(&FbTk::Button::window));
600 598
601 LabelList::iterator btn_it = find_if(m_labelbuttons.begin(), 599 LabelList::iterator btn_it = find_if(m_labelbuttons.begin(),
602 m_labelbuttons.end(), 600 m_labelbuttons.end(),
@@ -769,10 +767,14 @@ void FbWinFrame::redrawTitle() {
769 (*btn_it)->moveResize(last_x - border_width, - border_width, 767 (*btn_it)->moveResize(last_x - border_width, - border_width,
770 button_width + extra, 768 button_width + extra,
771 label().height() + border_width); 769 label().height() + border_width);
772 if (isVisible()) { 770
773 (*btn_it)->clear(); 771
774 (*btn_it)->updateTransparent(); 772 }
775 } 773
774 if (isVisible()) {
775 for_each(m_labelbuttons.begin(),
776 m_labelbuttons.end(),
777 mem_fun(&FbTk::Button::clear));
776 } 778 }
777 779
778 if (isVisible()) { 780 if (isVisible()) {
@@ -977,20 +979,19 @@ void FbWinFrame::renderButtons() {
977 m_button_size, m_button_size); 979 m_button_size, m_button_size);
978 980
979 // setup left and right buttons 981 // setup left and right buttons
980 for (size_t i=0; i < m_buttons_left.size(); ++i) { 982 for (size_t i=0; i < m_buttons_left.size(); ++i)
981 setupButton(*m_buttons_left[i]); 983 setupButton(*m_buttons_left[i]);
982 if (isVisible()) {
983 m_buttons_left[i]->clear();
984 m_buttons_left[i]->updateTransparent();
985 }
986 }
987 984
988 for (size_t i=0; i < m_buttons_right.size(); ++i) { 985 for (size_t i=0; i < m_buttons_right.size(); ++i)
989 setupButton(*m_buttons_right[i]); 986 setupButton(*m_buttons_right[i]);
990 if (isVisible()) { 987
991 m_buttons_right[i]->clear(); 988 if (isVisible()) {
992 m_buttons_right[i]->updateTransparent(); 989 for_each(m_buttons_left.begin(),
993 } 990 m_buttons_left.end(),
991 mem_fun(&FbTk::Button::clear));
992 for_each(m_buttons_right.begin(),
993 m_buttons_right.end(),
994 mem_fun(&FbTk::Button::clear));
994 } 995 }
995 996
996} 997}
@@ -1226,19 +1227,12 @@ void FbWinFrame::renderButtonUnfocus(FbTk::TextButton &button) {
1226void FbWinFrame::updateTransparent() { 1227void FbWinFrame::updateTransparent() {
1227 redrawTitlebar(); 1228 redrawTitlebar();
1228 1229
1229 ButtonList::iterator button_it = m_buttons_left.begin(); 1230 for_each(m_buttons_left.begin(),
1230 ButtonList::iterator button_it_end = m_buttons_left.end(); 1231 m_buttons_left.end(),
1231 for (; button_it != button_it_end; ++button_it) { 1232 mem_fun(&FbTk::Button::clear));
1232 (*button_it)->clear(); 1233 for_each(m_buttons_right.begin(),
1233 (*button_it)->updateTransparent(); 1234 m_buttons_right.end(),
1234 } 1235 mem_fun(&FbTk::Button::clear));
1235
1236 button_it = m_buttons_right.begin();
1237 button_it_end = m_buttons_right.end();
1238 for (; button_it != button_it_end; ++button_it) {
1239 (*button_it)->clear();
1240 (*button_it)->updateTransparent();
1241 }
1242 1236
1243 m_grip_left.clear(); 1237 m_grip_left.clear();
1244 m_grip_left.updateTransparent(); 1238 m_grip_left.updateTransparent();
@@ -1246,7 +1240,6 @@ void FbWinFrame::updateTransparent() {
1246 m_grip_right.updateTransparent(); 1240 m_grip_right.updateTransparent();
1247 m_handle.clear(); 1241 m_handle.clear();
1248 m_handle.updateTransparent(); 1242 m_handle.updateTransparent();
1249
1250} 1243}
1251 1244
1252 1245