summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui.cc27
-rw-r--r--src/ui.hh25
2 files changed, 24 insertions, 28 deletions
diff --git a/src/ui.cc b/src/ui.cc
index fc8624c6..4d8ee7c4 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -154,33 +154,6 @@ int CustInput::handle(int e)
//----------------------------------------------------------------------------
/*
- * A button that highlights on mouse over
- */
-class CustLightButton : public Fl_Button {
- Fl_Color norm_color;
-public:
- CustLightButton(int x, int y, int w, int h, const char *l=0) :
- Fl_Button(x,y,w,h,l) { norm_color = color(); };
- virtual int handle(int e);
-};
-
-int CustLightButton::handle(int e)
-{
- if (active()) {
- if (e == FL_ENTER) {
- color(51); // {17,26,51}
- redraw();
- } else if (e == FL_LEAVE || e == FL_RELEASE) {
- color(norm_color);
- redraw();
- }
- }
- return Fl_Button::handle(e);
-}
-
-//----------------------------------------------------------------------------
-
-/*
* Used to handle "paste" within the toolbar's Clear button.
*/
class CustPasteButton : public CustLightButton {
diff --git a/src/ui.hh b/src/ui.hh
index 6fd09b10..ca09723f 100644
--- a/src/ui.hh
+++ b/src/ui.hh
@@ -36,7 +36,7 @@ class CustProgressBox;
class CustTabs;
-// Class definition ----------------------------------------------------------
+// Class definitions ---------------------------------------------------------
/*
* Used to reposition group's widgets when some of them are hidden.
* All children get the height of the group but retain their original width.
@@ -98,6 +98,29 @@ public:
}
};
+/*
+ * A button that highlights on mouse over
+ */
+class CustLightButton : public Fl_Button {
+ Fl_Color norm_color, light_color;
+public:
+ CustLightButton(int x, int y, int w, int h, const char *l=0) :
+ Fl_Button(x,y,w,h,l) { norm_color = color(); light_color = 51; };
+ virtual int handle(int e)
+ {
+ if (active()) {
+ if (e == FL_ENTER) {
+ color(light_color); // {17,26,51}
+ redraw();
+ } else if (e == FL_LEAVE || e == FL_RELEASE) {
+ color(norm_color);
+ redraw();
+ }
+ }
+ return Fl_Button::handle(e);
+ }
+ void hl_color(Fl_Color col) { light_color = col; };
+};
//
// UI class definition -------------------------------------------------------