Skip to content

Commit

Permalink
Use He.Slider
Browse files Browse the repository at this point in the history
  • Loading branch information
lainsce committed Jan 30, 2024
1 parent d0d72c6 commit 41cac0d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
15 changes: 6 additions & 9 deletions fuses/appearance/AppearanceView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -391,20 +391,17 @@ public class AppearanceView : Gtk.Box {

var roundness_adjustment = new Gtk.Adjustment (-1, 0.0, 3.0, 1.0, 0, 0);

var roundness_scale = new Gtk.Scale (Gtk.Orientation.HORIZONTAL, roundness_adjustment) {
draw_value = false,
var roundness_scale = new He.Slider () {
hexpand = true
};
roundness_scale.add_mark (1.0, Gtk.PositionType.TOP, null);
roundness_scale.add_mark (2.0, Gtk.PositionType.TOP, null);

var roundness_spinbutton = new Gtk.SpinButton (roundness_adjustment, 0.25, 2) {
valign = Gtk.Align.CENTER
};
roundness_scale.scale.orientation = Gtk.Orientation.HORIZONTAL;
roundness_scale.scale.adjustment = roundness_adjustment;
roundness_scale.scale.draw_value = false;
roundness_scale.stop_indicator_visibility = true;
roundness_scale.scale.add_mark (1.0, Gtk.PositionType.TOP, null);

var roundness_control_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12);
roundness_control_box.append (roundness_scale);
roundness_control_box.append (roundness_spinbutton);

var roundness_title_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12);
roundness_title_box.append (roundness_label);
Expand Down
33 changes: 13 additions & 20 deletions fuses/appearance/TextView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,19 @@ public class Appearance.TextView : Gtk.Box {
};
size_label.add_css_class ("cb-title");

var size_adjustment = new Gtk.Adjustment (-1, 0.75, 1.5, 0.05, 0, 0);
var size_adjustment = new Gtk.Adjustment (-1, 0.75, 2.0, 0.1, 0, 0);

var size_scale = new Gtk.Scale (Gtk.Orientation.HORIZONTAL, size_adjustment) {
draw_value = false,
var size_scale = new He.Slider () {
hexpand = true
};
size_scale.add_mark (1, Gtk.PositionType.TOP, null);
size_scale.add_mark (1.25, Gtk.PositionType.TOP, null);

var size_spinbutton = new Gtk.SpinButton (size_adjustment, 0.25, 2) {
valign = Gtk.Align.CENTER
};
size_scale.scale.orientation = Gtk.Orientation.HORIZONTAL;
size_scale.scale.adjustment = size_adjustment;
size_scale.scale.draw_value = false;
size_scale.stop_indicator_visibility = true;
size_scale.scale.add_mark (1, Gtk.PositionType.TOP, null);

var size_control_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12);
size_control_box.append (size_scale);
size_control_box.append (size_spinbutton);

var size_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 6);
size_box.append (size_label);
Expand All @@ -49,21 +46,17 @@ public class Appearance.TextView : Gtk.Box {

var font_weight_adjustment = new Gtk.Adjustment (-1, 0.75, 2.0, 0.0858, 0, 0);

var font_weight_scale = new Gtk.Scale (Gtk.Orientation.HORIZONTAL, font_weight_adjustment) {
draw_value = false,
var font_weight_scale = new He.Slider () {
hexpand = true
};
font_weight_scale.add_mark (1.0, Gtk.PositionType.TOP, null);
font_weight_scale.add_mark (1.5, Gtk.PositionType.TOP, null);
font_weight_scale.add_mark (2.0, Gtk.PositionType.TOP, null);

var font_weight_spinbutton = new Gtk.SpinButton (font_weight_adjustment, 0.25, 2) {
valign = Gtk.Align.CENTER
};
font_weight_scale.scale.orientation = Gtk.Orientation.HORIZONTAL;
font_weight_scale.scale.adjustment = font_weight_adjustment;
font_weight_scale.scale.draw_value = false;
font_weight_scale.stop_indicator_visibility = true;
font_weight_scale.scale.add_mark (1.0, Gtk.PositionType.TOP, null);

var font_weight_control_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12);
font_weight_control_box.append (font_weight_scale);
font_weight_control_box.append (font_weight_spinbutton);

var font_weight_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 6);
font_weight_box.append (font_weight_label);
Expand Down

0 comments on commit 41cac0d

Please sign in to comment.