summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4b852b3)
raw | patch | inline | side by side (parent: 4b852b3)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 19 Nov 2006 02:54:07 +0000 (02:54 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 19 Nov 2006 02:54:07 +0000 (02:54 +0000) |
src/ui/widget/selected-style.cpp | patch | blob | history | |
src/widgets/widget-sizes.h | patch | blob | history |
index 20398ecd9f1d749eb3edb44e0cfe8ec7c3183d89..d44431b080430c822a419da6499dd036045e8391 100644 (file)
_stroke_flag_place (),
_opacity_place (),
- _opacity_adjustment (1.0, 0.0, 1.0, 0.01, 0.1),
- _opacity_sb (0.02, 2),
+ _opacity_adjustment (100, 0.0, 100, 1.0, 10.0),
+ _opacity_sb (0.02, 0),
_stroke (),
_stroke_width (""),
SelectedStyle::on_opacity_click(GdkEventButton *event)
{
if (event->button == 2) { // middle click
- const char* opacity = _opacity_sb.get_value() < 0.5? "0.5" : (_opacity_sb.get_value() == 1? "0" : "1");
+ const char* opacity = _opacity_sb.get_value() < 50? "0.5" : (_opacity_sb.get_value() == 100? "0" : "1");
SPCSSAttr *css = sp_repr_css_attr_new ();
sp_repr_css_set_property (css, "opacity", opacity);
sp_desktop_set_style (_desktop, css);
// Now query opacity
_tooltips.unset_tip(_opacity_place);
+ _tooltips.unset_tip(_opacity_sb);
int result = sp_desktop_query_style (_desktop, query, QUERY_STYLE_PROPERTY_MASTEROPACITY);
switch (result) {
case QUERY_STYLE_NOTHING:
_tooltips.set_tip(_opacity_place, _("Nothing selected"));
+ _tooltips.set_tip(_opacity_sb, _("Nothing selected"));
_opacity_sb.set_sensitive(false);
break;
case QUERY_STYLE_SINGLE:
case QUERY_STYLE_MULTIPLE_AVERAGED:
case QUERY_STYLE_MULTIPLE_SAME:
- _tooltips.set_tip(_opacity_place, _("Master opacity"));
+ _tooltips.set_tip(_opacity_place, _("Master opacity, %"));
+ _tooltips.set_tip(_opacity_sb, _("Master opacity, %"));
if (_opacity_blocked) break;
_opacity_blocked = true;
_opacity_sb.set_sensitive(true);
- _opacity_adjustment.set_value(SP_SCALE24_TO_FLOAT(query->opacity.value));
+ _opacity_adjustment.set_value(SP_SCALE24_TO_FLOAT(query->opacity.value) * 100);
_opacity_blocked = false;
break;
}
}
void SelectedStyle::opacity_0(void) {_opacity_sb.set_value(0);}
-void SelectedStyle::opacity_025(void) {_opacity_sb.set_value(0.25);}
-void SelectedStyle::opacity_05(void) {_opacity_sb.set_value(0.5);}
-void SelectedStyle::opacity_075(void) {_opacity_sb.set_value(0.75);}
-void SelectedStyle::opacity_1(void) {_opacity_sb.set_value(1.0);}
+void SelectedStyle::opacity_025(void) {_opacity_sb.set_value(25);}
+void SelectedStyle::opacity_05(void) {_opacity_sb.set_value(50);}
+void SelectedStyle::opacity_075(void) {_opacity_sb.set_value(75);}
+void SelectedStyle::opacity_1(void) {_opacity_sb.set_value(100);}
void SelectedStyle::on_opacity_menu (Gtk::Menu *menu) {
}
{
Gtk::MenuItem *item = new Gtk::MenuItem;
- item->add(*(new Gtk::Label("0.25", 0, 0)));
+ item->add(*(new Gtk::Label("25%", 0, 0)));
item->signal_activate().connect(sigc::mem_fun(*this, &SelectedStyle::opacity_025 ));
menu->add(*item);
}
{
Gtk::MenuItem *item = new Gtk::MenuItem;
- item->add(*(new Gtk::Label("0.5", 0, 0)));
+ item->add(*(new Gtk::Label("50%", 0, 0)));
item->signal_activate().connect(sigc::mem_fun(*this, &SelectedStyle::opacity_05 ));
menu->add(*item);
}
{
Gtk::MenuItem *item = new Gtk::MenuItem;
- item->add(*(new Gtk::Label("0.75", 0, 0)));
+ item->add(*(new Gtk::Label("75%", 0, 0)));
item->signal_activate().connect(sigc::mem_fun(*this, &SelectedStyle::opacity_075 ));
menu->add(*item);
}
{
Gtk::MenuItem *item = new Gtk::MenuItem;
- item->add(*(new Gtk::Label(_("1.0 (opaque)"), 0, 0)));
+ item->add(*(new Gtk::Label(_("100% (opaque)"), 0, 0)));
item->signal_activate().connect(sigc::mem_fun(*this, &SelectedStyle::opacity_1 ));
menu->add(*item);
}
_opacity_blocked = true;
SPCSSAttr *css = sp_repr_css_attr_new ();
Inkscape::CSSOStringStream os;
- os << CLAMP (_opacity_adjustment.get_value(), 0.0, 1.0);
+ os << CLAMP ((_opacity_adjustment.get_value() / 100), 0.0, 1.0);
sp_repr_css_set_property (css, "opacity", os.str().c_str());
// FIXME: workaround for GTK breakage: display interruptibility sometimes results in GTK
// sending multiple value-changed events. As if when Inkscape interrupts redraw for main loop
index e63e7f06c4be0acf54acf5bca6038d1ccc3c566e..c3290a8e2bb115c861801b310c71cfc8874003f0 100644 (file)
#define STATUS_ZOOM_WIDTH 57
-#define SELECTED_STYLE_SB_WIDTH 40
+#define SELECTED_STYLE_SB_WIDTH 38
#define SELECTED_STYLE_WIDTH 150
#define STYLE_SWATCH_WIDTH 80