]> Dogcows Code - chaz/openbox/commitdiff
various fixes to the otk widgets
authorDana Jansens <danakj@orodu.net>
Wed, 5 Feb 2003 05:48:01 +0000 (05:48 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 5 Feb 2003 05:48:01 +0000 (05:48 +0000)
otk/Makefile.am
otk/appwidget.cc
otk/appwidget.hh
otk/button.cc
otk/focuslabel.cc
otk/focuswidget.cc
otk/label.cc

index e1fb64dea379fde89bb81dcbbfae9130279d1783..992d7344183d698ad80acd58a33431a99c3f23c2 100644 (file)
@@ -27,7 +27,8 @@ includeotk_HEADERS=application.hh appwidget.hh assassin.hh button.hh \
                    point.hh property.hh pseudorendercontrol.hh rect.hh \
                    rendercolor.hh rendercontrol.hh renderstyle.hh \
                    rendertexture.hh screeninfo.hh strut.hh surface.hh \
-                   timer.hh truerendercontrol.hh ustring.hh util.hh widget.hh
+                   timer.hh truerendercontrol.hh ustring.hh util.hh widget.hh \
+                   ../config.h
 libotk_la_LDFLAGS = $(XFT_LIBS) $(PYTHON_LIBS) @LIBS@
 
 MAINTAINERCLEANFILES= Makefile.in
index c62a0d924720ae936956d1ab888385f632fa5539..afb86c0bb6a859e564ae9775abdd195a315382f6 100644 (file)
@@ -26,12 +26,21 @@ AppWidget::AppWidget(Application *app, Direction direction,
   protocols[0] = Property::atoms.wm_protocols;
   protocols[1] = Property::atoms.wm_delete_window;
   XSetWMProtocols(**display, window(), protocols, 2);
+
+  setStyle(_style);
 }
 
 AppWidget::~AppWidget()
 {
 }
 
+void AppWidget::setStyle(RenderStyle *style)
+{
+  Widget::setStyle(style);
+
+  setTexture(style->titlebarUnfocusBackground());
+}
+
 void AppWidget::show(void)
 {
   Widget::show(true);
index 69cca58938d50628801b54d6cc9f14f6588d3683..b305dbae4a15e0e5b37a3896817be77818f7655c 100644 (file)
@@ -15,6 +15,8 @@ public:
             Cursor cursor = 0, int bevel_width = 1);
   virtual ~AppWidget();
 
+  virtual void setStyle(RenderStyle *style);
+  
   virtual void show(void);
   virtual void hide(void);
 
index 08dc0484a50f6b2192e306fb595227b7b3150981..c70511fc3b98e6c6bb88bbcd56c6407250f42e7c 100644 (file)
@@ -35,10 +35,10 @@ void Button::press(unsigned int mouse_button)
 {
   if (_pressed) return;
 
-  if (_pressed_focus_tx)
-    FocusWidget::setTexture(_pressed_focus_tx);
   if (_pressed_unfocus_tx)
     FocusWidget::setUnfocusTexture(_pressed_unfocus_tx);
+  if (_pressed_focus_tx)
+    FocusWidget::setTexture(_pressed_focus_tx);
   _pressed = true;
   _mouse_button = mouse_button;
 }
@@ -47,8 +47,8 @@ void Button::release(unsigned int mouse_button)
 {
   if (_mouse_button != mouse_button) return; // wrong button
 
-  FocusWidget::setTexture(_unpr_focus_tx);
   FocusWidget::setUnfocusTexture(_unpr_unfocus_tx);
+  FocusWidget::setTexture(_unpr_focus_tx);
   _pressed = false;
 }
 
index 8ac328e7122d639a892f359fb789ef3de78cd066..bd74aa94fde064de2addd49ffb3545276d41a89b 100644 (file)
@@ -58,7 +58,7 @@ void FocusLabel::update()
         internalResize(w, h);
       else
         internalResize(w, _rect.height());
-    } else
+    } else if (h > _rect.height())
       internalResize(_rect.width(), h);
   }
   FocusWidget::update();
index e3973dc233d81b40b1607114c1513a54187ce322..b8e18d7875596580749836939224880293765bd4 100644 (file)
@@ -53,6 +53,8 @@ void FocusWidget::setTexture(RenderTexture *texture)
 {
   Widget::setTexture(texture);
   _focus_texture = texture;
+  if (!_focused)
+    Widget::setTexture(_unfocus_texture);
 }
 
 void FocusWidget::setBorderColor(const RenderColor *color)
index 8352fb7a9b82eced7d43520344a0b62632a44810..f0a4b66566b31749b3e0e82829cda4ba07913c82 100644 (file)
@@ -54,7 +54,7 @@ void Label::update()
         internalResize(w, h);
       else
         internalResize(w, _rect.height());
-    } else
+    } else if (h > _rect.height())
       internalResize(_rect.width(), h);
   }
   Widget::update();
This page took 0.029277 seconds and 4 git commands to generate.