Skip to content

Commit cfef3cc

Browse files
authored
Merge branch 'master' into jeremypw/gtk4prep/terminal-context-menu
2 parents 6892638 + 30d8854 commit cfef3cc

14 files changed

Lines changed: 51 additions & 349 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
image: ghcr.io/elementary/docker:${{ matrix.version }}
1919

2020
steps:
21-
- uses: actions/checkout@v6
21+
- uses: actions/checkout@v7
2222
- name: Install Dependencies
2323
run: |
2424
apt update
@@ -50,7 +50,7 @@ jobs:
5050

5151
steps:
5252
- name: Checkout
53-
uses: actions/checkout@v6
53+
uses: actions/checkout@v7
5454

5555
- name: Build
5656
uses: flatpak/flatpak-github-actions/flatpak-builder@v6.7
@@ -71,7 +71,7 @@ jobs:
7171

7272
steps:
7373
- name: Checkout
74-
uses: actions/checkout@v6
74+
uses: actions/checkout@v7
7575

7676
- name: Lint
7777
run: io.elementary.vala-lint -d .

.github/workflows/merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
steps:
1111
- name: Clone repository
12-
uses: actions/checkout@v6
12+
uses: actions/checkout@v7
1313
with:
1414
token: ${{ secrets.GIT_USER_TOKEN }}
1515

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
if: github.event.pull_request.merged == true && true == contains(join(github.event.pull_request.labels.*.name), 'Release')
1111
steps:
12-
- uses: actions/checkout@v6
12+
- uses: actions/checkout@v7
1313
- uses: elementary/actions/release@main
1414
env:
1515
GIT_USER_TOKEN: "${{ secrets.GIT_USER_TOKEN }}"

plugins/pastebin/pastebin_dialog.vala

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,10 @@ namespace Scratch.Dialogs {
316316
};
317317

318318
stack = new Gtk.Stack () {
319-
margin = 12,
320-
margin_top = 0
319+
margin_top = 0,
320+
margin_bottom = 12,
321+
margin_start = 12,
322+
margin_end = 12
321323
};
322324
stack.add (grid);
323325
stack.add (spinner);
@@ -362,7 +364,10 @@ namespace Scratch.Dialogs {
362364
for (var i=0; i < languages.length[0]; i++) {
363365
var label = new Gtk.Label (languages[i, 2]) {
364366
halign = Gtk.Align.START,
365-
margin = 6
367+
margin_top = 6,
368+
margin_bottom = 6,
369+
margin_start = 6,
370+
margin_end = 6
366371
};
367372

368373
languages_listbox.add (label);
@@ -382,8 +387,10 @@ namespace Scratch.Dialogs {
382387
select_button.clicked.connect (select_button_clicked);
383388

384389
var frame = new Gtk.Frame (null) {
385-
margin = 12,
386-
margin_top = 0
390+
margin_top = 0,
391+
margin_bottom = 12,
392+
margin_start = 12,
393+
margin_end = 12
387394
};
388395
frame.add (languages_scrolled);
389396

src/Dialogs/PreferencesDialog.vala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,10 @@ public class Scratch.Dialogs.Preferences : Granite.Dialog {
143143
interface_box.add (font_box);
144144

145145
var stack = new Gtk.Stack () {
146-
margin = 12,
146+
margin_top = 12,
147+
margin_bottom = 12,
148+
margin_start = 12,
149+
margin_end = 12,
147150
vhomogeneous = true
148151
};
149152
stack.add_titled (behavior_box, "behavior", _("Behavior"));

src/MainWindow.vala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ namespace Scratch {
9393
public const string ACTION_REVERT = "action-revert";
9494
public const string ACTION_SAVE = "action-save";
9595
public const string ACTION_SAVE_AS = "action-save-as";
96-
public const string ACTION_TEMPLATES = "action-templates";
9796
public const string ACTION_SHOW_REPLACE = "action-show-replace";
9897
public const string ACTION_TO_LOWER_CASE = "action-to-lower-case";
9998
public const string ACTION_TO_UPPER_CASE = "action-to-upper-case";
@@ -149,7 +148,6 @@ namespace Scratch {
149148
{ ACTION_SAVE, action_save },
150149
{ ACTION_SAVE_AS, action_save_as },
151150
{ ACTION_TOGGLE_SHOW_FIND, action_toggle_show_find, null, "false" },
152-
{ ACTION_TEMPLATES, action_templates },
153151
{ ACTION_GO_TO, action_go_to },
154152
{ ACTION_SORT_LINES, action_sort_lines },
155153
{ ACTION_NEW_TAB, action_new_tab },
@@ -342,10 +340,6 @@ namespace Scratch {
342340
// Show/Hide widgets
343341
show_all ();
344342

345-
toolbar.templates_button.visible = (plugins.plugin_iface.template_manager.template_available);
346-
plugins.plugin_iface.template_manager.notify["template_available"].connect (() => {
347-
toolbar.templates_button.visible = (plugins.plugin_iface.template_manager.template_available);
348-
});
349343

350344
// Create folder for unsaved documents
351345
create_unsaved_documents_directory ();
@@ -1371,9 +1365,6 @@ namespace Scratch {
13711365
toolbar.format_bar.line_menubutton.active = true;
13721366
}
13731367

1374-
private void action_templates () {
1375-
plugins.plugin_iface.template_manager.show_window (this);
1376-
}
13771368

13781369
private void action_to_lower_case () {
13791370
var doc = document_view.current_document;

src/Services/Document.vala

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -256,24 +256,16 @@ namespace Scratch.Services {
256256

257257
this.source_view.buffer.create_tag ("highlight_search_all", "background", "yellow", null);
258258

259-
// Focus in event for SourceView
260-
// Check if file changed externally or permissions changed
261-
this.source_view.focus_in_event.connect (() => {
262-
if (!locked && !is_file_temporary) {
263-
check_undoable_actions ();
264-
check_file_status.begin ();
265-
}
266-
267-
return false;
268-
});
269-
270-
// Focus out event for SourceView
271-
this.source_view.focus_out_event.connect (() => {
272-
if (!locked && Scratch.settings.get_boolean ("autosave")) {
273-
save_with_hold.begin ();
259+
this.source_view.notify["is-focus"].connect (() => {
260+
return_if_fail (!locked);
261+
if (source_view.is_focus) {
262+
if (!is_file_temporary) {
263+
check_undoable_actions ();
264+
check_file_status.begin ();
265+
}
266+
} else if (Scratch.settings.get_boolean ("autosave")) {
267+
save_with_hold.begin ();
274268
}
275-
276-
return false;
277269
});
278270

279271
source_view.buffer.changed.connect (() => {

src/Services/PluginManager.vala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public class Scratch.Services.Interface : GLib.Object {
2222
public signal void hook_preferences_dialog (Scratch.Dialogs.Preferences dialog);
2323
public signal void hook_folder_item_change (File file, File? other_file, FileMonitorEvent event_type);
2424

25-
public Scratch.TemplateManager template_manager { get; private set; }
2625
public Scratch.Services.PluginsManager manager { get; construct; }
2726

2827
public Interface (Scratch.Services.PluginsManager _manager) {
@@ -31,10 +30,6 @@ public class Scratch.Services.Interface : GLib.Object {
3130
);
3231
}
3332

34-
construct {
35-
template_manager = new Scratch.TemplateManager ();
36-
}
37-
3833
public Scratch.Services.Document open_file (File file) {
3934
var doc = new Scratch.Services.Document (manager.window.actions, file);
4035
manager.window.open_document.begin (doc);

0 commit comments

Comments
 (0)