(From issue #1027) The Adjuster's spin button is now frameless to solve (as a workaround) alignment inconsistency.
This commit is contained in:
@@ -153,6 +153,13 @@ style "clearlooks-spinbutton" {
|
||||
}
|
||||
}
|
||||
|
||||
style "clearlooks-framelessspinbutton" {
|
||||
|
||||
# IMPORTANT!
|
||||
# base[NORMAL] must have the same color than notebook bg[NORMAL]
|
||||
base[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
}
|
||||
|
||||
style "clearlooks-scale" {
|
||||
xthickness = 2
|
||||
ythickness = 2
|
||||
@@ -209,6 +216,8 @@ style "clearlooks-vscrollbar" {
|
||||
|
||||
style "clearlooks-notebook_bg" {
|
||||
|
||||
# IMPORTANT!
|
||||
# If you modify bg[NORMAL] here under, you must set clearlooks-framelessspinbutton -> base[NORMAL] to the very same value
|
||||
bg[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
bg[ACTIVE] = @rt_base_color
|
||||
}
|
||||
@@ -454,6 +463,7 @@ widget_class "*.<GtkCList>.<GtkButton>" style "clearlooks-treeview_header"
|
||||
widget "*.partialPasteHeader.*" style "clearlooks-frame_title"
|
||||
widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep"
|
||||
widget "*.histButton" style "clearlooks-histButton"
|
||||
widget "*.FramelessSpinButton" style "clearlooks-framelessspinbutton"
|
||||
|
||||
# The window of the tooltip is called "gtk-tooltip"
|
||||
##################################################################
|
||||
|
@@ -153,6 +153,13 @@ style "clearlooks-spinbutton" {
|
||||
}
|
||||
}
|
||||
|
||||
style "clearlooks-framelessspinbutton" {
|
||||
|
||||
# IMPORTANT!
|
||||
# base[NORMAL] must have the same color than notebook bg[NORMAL]
|
||||
base[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
}
|
||||
|
||||
style "clearlooks-scale" {
|
||||
xthickness = 2
|
||||
ythickness = 2
|
||||
@@ -209,6 +216,8 @@ style "clearlooks-vscrollbar" {
|
||||
|
||||
style "clearlooks-notebook_bg" {
|
||||
|
||||
# IMPORTANT!
|
||||
# If you modify bg[NORMAL] here under, you must set clearlooks-framelessspinbutton -> base[NORMAL] to the very same value
|
||||
bg[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
bg[ACTIVE] = shade (0.80, @rt_bg_color)
|
||||
}
|
||||
@@ -454,6 +463,7 @@ widget_class "*.<GtkCList>.<GtkButton>" style "clearlooks-treeview_header"
|
||||
widget "*.partialPasteHeader.*" style "clearlooks-frame_title"
|
||||
widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep"
|
||||
widget "*.histButton" style "clearlooks-histButton"
|
||||
widget "*.FramelessSpinButton" style "clearlooks-framelessspinbutton"
|
||||
|
||||
# The window of the tooltip is called "gtk-tooltip"
|
||||
##################################################################
|
||||
|
@@ -153,6 +153,13 @@ style "clearlooks-spinbutton" {
|
||||
}
|
||||
}
|
||||
|
||||
style "clearlooks-framelessspinbutton" {
|
||||
|
||||
# IMPORTANT!
|
||||
# base[NORMAL] must have the same color than notebook bg[NORMAL]
|
||||
base[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
}
|
||||
|
||||
style "clearlooks-scale" {
|
||||
xthickness = 2
|
||||
ythickness = 2
|
||||
@@ -209,6 +216,8 @@ style "clearlooks-vscrollbar" {
|
||||
|
||||
style "clearlooks-notebook_bg" {
|
||||
|
||||
# IMPORTANT!
|
||||
# If you modify bg[NORMAL] here under, you must set clearlooks-framelessspinbutton -> base[NORMAL] to the very same value
|
||||
bg[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
bg[ACTIVE] = @rt_base_color
|
||||
}
|
||||
@@ -465,6 +474,7 @@ widget_class "*.<GtkCList>.<GtkButton>" style "clearlooks-treeview_header"
|
||||
widget "*.partialPasteHeader.*" style "clearlooks-frame_title"
|
||||
widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep"
|
||||
widget "*.histButton" style "clearlooks-histButton"
|
||||
widget "*.FramelessSpinButton" style "clearlooks-framelessspinbutton"
|
||||
|
||||
# The window of the tooltip is called "gtk-tooltip"
|
||||
##################################################################
|
||||
|
@@ -153,6 +153,13 @@ style "clearlooks-spinbutton" {
|
||||
}
|
||||
}
|
||||
|
||||
style "clearlooks-framelessspinbutton" {
|
||||
|
||||
# IMPORTANT!
|
||||
# base[NORMAL] must have the same color than notebook bg[NORMAL]
|
||||
base[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
}
|
||||
|
||||
style "clearlooks-scale" {
|
||||
xthickness = 2
|
||||
ythickness = 2
|
||||
@@ -209,6 +216,8 @@ style "clearlooks-vscrollbar" {
|
||||
|
||||
style "clearlooks-notebook_bg" {
|
||||
|
||||
# IMPORTANT!
|
||||
# If you modify bg[NORMAL] here under, you must set clearlooks-framelessspinbutton -> base[NORMAL] to the very same value
|
||||
bg[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
bg[ACTIVE] = shade (0.80, @rt_bg_color)
|
||||
}
|
||||
@@ -454,6 +463,7 @@ widget_class "*.<GtkCList>.<GtkButton>" style "clearlooks-treeview_header"
|
||||
widget "*.partialPasteHeader.*" style "clearlooks-frame_title"
|
||||
widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep"
|
||||
widget "*.histButton" style "clearlooks-histButton"
|
||||
widget "*.FramelessSpinButton" style "clearlooks-framelessspinbutton"
|
||||
|
||||
# The window of the tooltip is called "gtk-tooltip"
|
||||
##################################################################
|
||||
|
@@ -153,6 +153,13 @@ style "clearlooks-spinbutton" {
|
||||
}
|
||||
}
|
||||
|
||||
style "clearlooks-framelessspinbutton" {
|
||||
|
||||
# IMPORTANT!
|
||||
# base[NORMAL] must have the same color than notebook bg[NORMAL]
|
||||
base[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
}
|
||||
|
||||
style "clearlooks-scale" {
|
||||
xthickness = 2
|
||||
ythickness = 2
|
||||
@@ -209,6 +216,8 @@ style "clearlooks-vscrollbar" {
|
||||
|
||||
style "clearlooks-notebook_bg" {
|
||||
|
||||
# IMPORTANT!
|
||||
# If you modify bg[NORMAL] here under, you must set clearlooks-framelessspinbutton -> base[NORMAL] to the very same value
|
||||
bg[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
bg[ACTIVE] = shade (0.80, @rt_bg_color)
|
||||
}
|
||||
@@ -454,6 +463,7 @@ widget_class "*.<GtkCList>.<GtkButton>" style "clearlooks-treeview_header"
|
||||
widget "*.partialPasteHeader.*" style "clearlooks-frame_title"
|
||||
widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep"
|
||||
widget "*.histButton" style "clearlooks-histButton"
|
||||
widget "*.FramelessSpinButton" style "clearlooks-framelessspinbutton"
|
||||
|
||||
# The window of the tooltip is called "gtk-tooltip"
|
||||
##################################################################
|
||||
|
@@ -153,6 +153,13 @@ style "clearlooks-spinbutton" {
|
||||
}
|
||||
}
|
||||
|
||||
style "clearlooks-framelessspinbutton" {
|
||||
|
||||
# IMPORTANT!
|
||||
# base[NORMAL] must have the same color than notebook bg[NORMAL]
|
||||
base[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
}
|
||||
|
||||
style "clearlooks-scale" {
|
||||
xthickness = 2
|
||||
ythickness = 2
|
||||
@@ -209,6 +216,8 @@ style "clearlooks-vscrollbar" {
|
||||
|
||||
style "clearlooks-notebook_bg" {
|
||||
|
||||
# IMPORTANT!
|
||||
# If you modify bg[NORMAL] here under, you must set clearlooks-framelessspinbutton -> base[NORMAL] to the very same value
|
||||
bg[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
bg[ACTIVE] = shade (0.80, @rt_bg_color)
|
||||
}
|
||||
@@ -454,6 +463,7 @@ widget_class "*.<GtkCList>.<GtkButton>" style "clearlooks-treeview_header"
|
||||
widget "*.partialPasteHeader.*" style "clearlooks-frame_title"
|
||||
widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep"
|
||||
widget "*.histButton" style "clearlooks-histButton"
|
||||
widget "*.FramelessSpinButton" style "clearlooks-framelessspinbutton"
|
||||
|
||||
# The window of the tooltip is called "gtk-tooltip"
|
||||
##################################################################
|
||||
|
@@ -155,6 +155,13 @@ style "clearlooks-spinbutton" {
|
||||
}
|
||||
}
|
||||
|
||||
style "clearlooks-framelessspinbutton" {
|
||||
|
||||
# IMPORTANT!
|
||||
# base[NORMAL] must have the same color than notebook bg[NORMAL]
|
||||
base[NORMAL] = @rt_bg_color
|
||||
}
|
||||
|
||||
style "clearlooks-scale" {
|
||||
xthickness = 2
|
||||
ythickness = 2
|
||||
@@ -558,6 +565,8 @@ style "clearlooks-range" {
|
||||
|
||||
style "clearlooks-notebook_bg" {
|
||||
|
||||
# IMPORTANT!
|
||||
# If you modify bg[NORMAL] here under, you must set clearlooks-framelessspinbutton -> base[NORMAL] to the very same value
|
||||
bg[NORMAL] = @rt_bg_color
|
||||
bg[ACTIVE] = shade (0.85, @rt_bg_color)
|
||||
}
|
||||
@@ -805,6 +814,7 @@ widget_class "*.<GtkCList>.<GtkButton>" style "clearlooks-treeview_header"
|
||||
widget "*.partialPasteHeader.*" style "clearlooks-frame_title"
|
||||
widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep"
|
||||
widget "*.histButton" style "clearlooks-histButton"
|
||||
widget "*.FramelessSpinButton" style "clearlooks-framelessspinbutton"
|
||||
|
||||
# The window of the tooltip is called "gtk-tooltip"
|
||||
##################################################################
|
||||
|
@@ -153,6 +153,13 @@ style "clearlooks-spinbutton" {
|
||||
}
|
||||
}
|
||||
|
||||
style "clearlooks-framelessspinbutton" {
|
||||
|
||||
# IMPORTANT!
|
||||
# base[NORMAL] must have the same color than notebook bg[NORMAL]
|
||||
base[NORMAL] = @rt_bg_color
|
||||
}
|
||||
|
||||
style "clearlooks-scale" {
|
||||
xthickness = 2
|
||||
ythickness = 2
|
||||
@@ -209,6 +216,8 @@ style "clearlooks-vscrollbar" {
|
||||
|
||||
style "clearlooks-notebook_bg" {
|
||||
|
||||
# IMPORTANT!
|
||||
# If you modify bg[NORMAL] here under, you must set clearlooks-framelessspinbutton -> base[NORMAL] to the very same value
|
||||
bg[NORMAL] = @rt_bg_color
|
||||
bg[ACTIVE] = shade (0.85, @rt_bg_color)
|
||||
}
|
||||
@@ -455,6 +464,7 @@ widget_class "*.<GtkCList>.<GtkButton>" style "clearlooks-treeview_header"
|
||||
widget "*.partialPasteHeader.*" style "clearlooks-frame_title"
|
||||
widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep"
|
||||
widget "*.histButton" style "clearlooks-histButton"
|
||||
widget "*.FramelessSpinButton" style "clearlooks-framelessspinbutton"
|
||||
|
||||
# The window of the tooltip is called "gtk-tooltip"
|
||||
##################################################################
|
||||
|
@@ -153,6 +153,13 @@ style "clearlooks-spinbutton" {
|
||||
}
|
||||
}
|
||||
|
||||
style "clearlooks-framelessspinbutton" {
|
||||
|
||||
# IMPORTANT!
|
||||
# base[NORMAL] must have the same color than notebook bg[NORMAL]
|
||||
base[NORMAL] = shade (1.05, @rt_bg_color)
|
||||
}
|
||||
|
||||
style "clearlooks-scale" {
|
||||
xthickness = 2
|
||||
ythickness = 2
|
||||
@@ -209,6 +216,8 @@ style "clearlooks-vscrollbar" {
|
||||
|
||||
style "clearlooks-notebook_bg" {
|
||||
|
||||
# IMPORTANT!
|
||||
# If you modify bg[NORMAL] here under, you must set clearlooks-framelessspinbutton -> base[NORMAL] to the very same value
|
||||
bg[NORMAL] = shade (1.05, @rt_bg_color)
|
||||
bg[ACTIVE] = shade (0.92, @rt_bg_color)
|
||||
}
|
||||
@@ -455,6 +464,7 @@ widget_class "*.<GtkCList>.<GtkButton>" style "clearlooks-treeview_header"
|
||||
widget "*.partialPasteHeader.*" style "clearlooks-frame_title"
|
||||
widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep"
|
||||
widget "*.histButton" style "clearlooks-histButton"
|
||||
widget "*.FramelessSpinButton" style "clearlooks-framelessspinbutton"
|
||||
|
||||
# The window of the tooltip is called "gtk-tooltip"
|
||||
##################################################################
|
||||
|
@@ -153,6 +153,13 @@ style "clearlooks-spinbutton" {
|
||||
}
|
||||
}
|
||||
|
||||
style "clearlooks-framelessspinbutton" {
|
||||
|
||||
# IMPORTANT!
|
||||
# base[NORMAL] must have the same color than notebook bg[NORMAL]
|
||||
base[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
}
|
||||
|
||||
style "clearlooks-scale" {
|
||||
xthickness = 2
|
||||
ythickness = 2
|
||||
@@ -209,6 +216,8 @@ style "clearlooks-vscrollbar" {
|
||||
|
||||
style "clearlooks-notebook_bg" {
|
||||
|
||||
# IMPORTANT!
|
||||
# If you modify bg[NORMAL] here under, you must set clearlooks-framelessspinbutton -> base[NORMAL] to the very same value
|
||||
bg[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
}
|
||||
|
||||
@@ -442,6 +451,7 @@ widget_class "*.<GtkCList>.<GtkButton>" style "clearlooks-treeview_header"
|
||||
widget "*.partialPasteHeader.*" style "clearlooks-frame_title"
|
||||
widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep"
|
||||
widget "*.histButton" style "clearlooks-histButton"
|
||||
widget "*.FramelessSpinButton" style "clearlooks-framelessspinbutton"
|
||||
|
||||
# The window of the tooltip is called "gtk-tooltip"
|
||||
##################################################################
|
||||
|
@@ -142,6 +142,13 @@ style "clearlooks-spinbutton" {
|
||||
}
|
||||
}
|
||||
|
||||
style "clearlooks-framelessspinbutton" {
|
||||
|
||||
# IMPORTANT!
|
||||
# base[NORMAL] must have the same color than notebook bg[NORMAL]
|
||||
base[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
}
|
||||
|
||||
style "clearlooks-scale" {
|
||||
xthickness = 2
|
||||
ythickness = 2
|
||||
@@ -190,6 +197,8 @@ style "clearlooks-vscrollbar" {
|
||||
|
||||
style "clearlooks-notebook_bg" {
|
||||
|
||||
# IMPORTANT!
|
||||
# If you modify bg[NORMAL] here under, you must set clearlooks-framelessspinbutton -> base[NORMAL] to the very same value
|
||||
bg[NORMAL] = shade (1.02, @rt_bg_color)
|
||||
}
|
||||
|
||||
@@ -395,6 +404,7 @@ widget_class "*.<GtkCList>.<GtkButton>" style "clearlooks-treeview_header"
|
||||
widget "*.partialPasteHeader.*" style "clearlooks-frame_title"
|
||||
widget "*.partialPasteHeaderSep" style "clearlooks-partialPasteHeaderSep"
|
||||
widget "*.histButton" style "clearlooks-histButton"
|
||||
widget "*.FramelessSpinButton" style "clearlooks-framelessspinbutton"
|
||||
|
||||
# The window of the tooltip is called "gtk-tooltip"
|
||||
##################################################################
|
||||
|
@@ -67,6 +67,8 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep
|
||||
hbox->pack_end (*reset, Gtk::PACK_SHRINK, 0);
|
||||
|
||||
spin = Gtk::manage (new MySpinButton ());
|
||||
spin->set_has_frame(false);
|
||||
spin->set_name("FramelessSpinButton");
|
||||
|
||||
hbox->pack_end (*spin, Gtk::PACK_SHRINK, 0);
|
||||
|
||||
@@ -132,6 +134,8 @@ Adjuster::Adjuster (Gtk::Image *imgIcon, double vmin, double vmax, double vstep,
|
||||
hbox->pack_end (*reset, Gtk::PACK_SHRINK, 0);
|
||||
|
||||
spin = Gtk::manage (new MySpinButton ());
|
||||
spin->set_has_frame(false);
|
||||
spin->set_name("FramelessSpinButton");
|
||||
|
||||
reset->set_size_request (-1, spin->get_height());
|
||||
|
||||
@@ -208,18 +212,13 @@ void Adjuster::setLimits (double vmin, double vmax, double vstep, double vdefaul
|
||||
spin->set_digits (digits);
|
||||
spin->set_increments (vstep, 2.0*vstep);
|
||||
spin->set_range (vmin, vmax);
|
||||
spin->updateSize();
|
||||
spin->set_value (shapeValue(vdefault));
|
||||
slider->set_digits (digits);
|
||||
slider->set_increments (vstep, 2.0*vstep);
|
||||
slider->set_range (vmin, vmax);
|
||||
slider->set_value (shapeValue(vdefault));
|
||||
//defaultVal = shapeValue (vdefault);
|
||||
|
||||
double maxAbs = fmax(fabs(vmin), fabs(vmax));
|
||||
int digits2;
|
||||
for (digits2=0; maxAbs/pow(double(10),digits2)>=1.0; digits2++);
|
||||
spin->set_width_chars(digits+digits2+(vmin<0?1:0)+(digits>0?1:0));
|
||||
|
||||
sliderChange.block (false);
|
||||
spinChange.block (false);
|
||||
}
|
||||
|
@@ -309,13 +309,44 @@ MySpinButton::MySpinButton () {
|
||||
Gtk::Border border;
|
||||
border.bottom = 0;
|
||||
border.top = 0;
|
||||
border.left = 0;
|
||||
border.right = 0;
|
||||
border.left = 3;
|
||||
border.right = 3;
|
||||
set_inner_border(border);
|
||||
set_numeric(true);
|
||||
set_wrap(true);
|
||||
set_alignment(Gtk::ALIGN_RIGHT);
|
||||
}
|
||||
|
||||
void MySpinButton::updateSize() {
|
||||
double vMin, vMax;
|
||||
double step, page;
|
||||
double maxAbs;
|
||||
unsigned int digits, digits2;
|
||||
unsigned int maxLen;
|
||||
|
||||
get_range(vMin, vMax);
|
||||
get_increments (step, page);
|
||||
|
||||
maxAbs = fmax(fabs(vMin), fabs(vMax));
|
||||
digits = get_digits();
|
||||
for (digits2=0; maxAbs/pow(double(10),digits2)>=1.0; digits2++);
|
||||
maxLen = digits+digits2+(vMin<0?1:0)+(digits>0?1:0);
|
||||
|
||||
set_max_length(maxLen);
|
||||
set_width_chars(maxLen);
|
||||
}
|
||||
|
||||
bool MySpinButton::on_key_press_event (GdkEventKey* event) {
|
||||
bool rcode = Gtk::Widget::on_key_press_event(event);
|
||||
if ( (event->string[0] >= 'a' && event->string[0] <= 'z')
|
||||
||(event->string[0] >= 'A' && event->string[0] <= 'Z')
|
||||
|| event->string[0] == '+'
|
||||
)
|
||||
return false;
|
||||
return rcode;
|
||||
}
|
||||
|
||||
bool MySpinButton::on_scroll_event (GdkEventScroll* event) {
|
||||
|
||||
// If Shift is pressed, the widget is modified
|
||||
if (event->state & GDK_SHIFT_MASK) {
|
||||
Gtk::SpinButton::on_scroll_event(event);
|
||||
|
@@ -109,10 +109,13 @@ public:
|
||||
*/
|
||||
class MySpinButton : public Gtk::SpinButton {
|
||||
|
||||
protected:
|
||||
bool on_scroll_event (GdkEventScroll* event);
|
||||
bool on_key_press_event (GdkEventKey* event);
|
||||
|
||||
public:
|
||||
MySpinButton ();
|
||||
void updateSize();
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user