summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2006-10-03 23:08:49 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2006-10-03 23:08:49 +0000
commit3c03eb67a0467d9406a053716ceeb1de6e33ba41 (patch)
tree4415dc45313faa04cfa822c85cb9533fbdfbcf03 /src
parent7febae3f9e6f340f775eac5bee3e783fdd361aaa (diff)
More cleanup of GTK+ scheme - menu buttons now use the new look-n-feel,
and I also fixed the radio button offset for the plastic scheme. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5506 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Light_Button.cxx2
-rw-r--r--src/Fl_Menu.cxx28
2 files changed, 26 insertions, 4 deletions
diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx
index 1fc5e0636..0e37333e1 100644
--- a/src/Fl_Light_Button.cxx
+++ b/src/Fl_Light_Button.cxx
@@ -122,7 +122,7 @@ void Fl_Light_Button::draw() {
if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.5));
fl_arc(x() + tdx, y() + tdy, tW + 1, tW + 1, 60.0, 180.0);
- } else fl_color(col);
+ }
}
break;
default :
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 3aee4efcb..c04a1c9b2 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -3,7 +3,7 @@
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2005 by Bill Spitzak and others.
+// Copyright 1998-2006 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -36,6 +36,7 @@
#include <FL/Fl_Menu_.H>
#include <FL/fl_draw.H>
#include <stdio.h>
+#include "flstring.h"
#ifdef __APPLE__
# include <Carbon/Carbon.h>
@@ -174,10 +175,22 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
if (flags & FL_MENU_RADIO) {
fl_draw_box(FL_ROUND_DOWN_BOX, x+2, y+d, W, W, FL_BACKGROUND2_COLOR);
if (value()) {
- fl_color(labelcolor_);
int tW = (W - Fl::box_dw(FL_ROUND_DOWN_BOX)) / 2 + 1;
if ((W - tW) & 1) tW++; // Make sure difference is even to center
int td = Fl::box_dx(FL_ROUND_DOWN_BOX) + 1;
+ if (Fl::scheme()) {
+ // Offset the radio circle...
+ td ++;
+
+ if (!strcmp(Fl::scheme(), "gtk+")) {
+ fl_color(FL_SELECTION_COLOR);
+ tW --;
+ fl_pie(x + td + 1, y + d + td - 1, tW + 3, tW + 3, 0.0, 360.0);
+ fl_arc(x + td + 1, y + d + td - 1, tW + 3, tW + 3, 0.0, 360.0);
+ fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.2));
+ } else fl_color(labelcolor_);
+ } else fl_color(labelcolor_);
+
switch (tW) {
// Larger circles draw fine...
default :
@@ -203,11 +216,20 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
fl_rectf(x + td + 2, y + d + td, tW, tW);
break;
}
+
+ if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
+ fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.5));
+ fl_arc(x + td + 2, y + d + td, tW + 1, tW + 1, 60.0, 180.0);
+ }
}
} else {
fl_draw_box(FL_DOWN_BOX, x+2, y+d, W, W, FL_BACKGROUND2_COLOR);
if (value()) {
- fl_color(labelcolor_);
+ if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) {
+ fl_color(FL_SELECTION_COLOR);
+ } else {
+ fl_color(labelcolor_);
+ }
int tx = x + 5;
int tw = W - 6;
int d1 = tw/3;