Skip to content

Commit

Permalink
Merge branch 'master' into jeremypw/expose-clearscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
zeebok authored Sep 12, 2024
2 parents dfff1a6 + 85c82c1 commit b531109
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/Widgets/SettingsPopover.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
public sealed class Terminal.SettingsPopover : Gtk.Popover {
public signal void show_theme_editor ();

public Vte.Terminal? terminal {
public TerminalWidget? terminal {
owned get {
return terminal_binding.source as Vte.Terminal;
return terminal_binding.source as TerminalWidget;
}

set {
Expand Down Expand Up @@ -40,23 +40,23 @@ public sealed class Terminal.SettingsPopover : Gtk.Popover {
_("Zoom out")
)
};
zoom_out_button.set_detailed_action_name (TerminalWidget.ACTION_ZOOM_OUT);
zoom_out_button.clicked.connect (() => terminal.decrease_font_size ());

var zoom_default_button = new Gtk.Button () {
tooltip_markup = Granite.markup_accel_tooltip (
TerminalWidget.ACCELS_ZOOM_DEFAULT,
_("Default zoom level")
)
};
zoom_default_button.set_detailed_action_name (TerminalWidget.ACTION_ZOOM_DEFAULT);
zoom_default_button.clicked.connect (() => terminal.default_font_size ());

var zoom_in_button = new Gtk.Button.from_icon_name ("zoom-in-symbolic") {
tooltip_markup = Granite.markup_accel_tooltip (
TerminalWidget.ACCELS_ZOOM_IN,
_("Zoom in")
)
};
zoom_in_button.set_detailed_action_name (TerminalWidget.ACTION_ZOOM_IN);
zoom_in_button.clicked.connect (() => terminal.increase_font_size ());

var font_size_box = new Gtk.Box (HORIZONTAL, 0) {
homogeneous = true,
Expand Down
7 changes: 6 additions & 1 deletion src/Widgets/TerminalWidget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ namespace Terminal {
select_all_action.activate.connect (select_all);
action_group.add_action (select_all_action);

//TODO In Gtk4 replace action with `add_binding_signal ()``
var zoom_action = new GLib.SimpleAction ("zoom", VariantType.STRING);
zoom_action.activate.connect ((p) => {
switch ((string) p) {
Expand All @@ -309,7 +310,7 @@ namespace Terminal {
decrease_font_size ();
break;
case "default":
font_scale = 1.0;
default_font_size ();
break;
}
});
Expand Down Expand Up @@ -753,6 +754,10 @@ namespace Terminal {
font_scale -= 0.1;
}

public void default_font_size () {
font_scale = 1.0;
}

public bool is_init_complete () {
return init_complete;
}
Expand Down

0 comments on commit b531109

Please sign in to comment.