Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GTK4 Prep] Update DocumentView to use Hdy.TabView #1424

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9421dcc
Switch to using Hdy.TabView instead of Granite.Widgets.DynamicNoteboo…
colinkiama Feb 29, 2024
7bcfbf0
Improve fuzzy search plugin's key press event detection when source v…
colinkiama Feb 29, 2024
cdf1cb9
Remove tab_name property from Document class
colinkiama Mar 13, 2024
848659f
`loading` property in `Document.vala` now only gets and sets loading …
colinkiama Mar 14, 2024
c6e5620
Merge branch 'master' into colinkiama/gtk4-prep-hdy-tab-view
jeremypw Mar 14, 2024
0d2a35a
Stop using redundant `search_for_document_in_tab()` method
colinkiama Mar 21, 2024
6682f25
Disconnect from tab.loading change notification signal
colinkiama Mar 21, 2024
a5b47bb
Add support for dragging tab out of window to open tab in new window …
colinkiama Mar 21, 2024
edae744
Add "Open in a New Window" menu option to tab view in DocumentView.
colinkiama Mar 21, 2024
c57931d
Setup document view tab view menu model once instead of every time th…
colinkiama Mar 21, 2024
d4d56de
Disabe tab menu actions based on target tab position
colinkiama Mar 21, 2024
a7e957a
Fix tab tracking bugs when transferring bugs across windows
colinkiama Mar 21, 2024
936da97
Close target tab when closing tab from tab context menu
colinkiama Mar 21, 2024
7b43bcb
Merge remote-tracking branch 'upstream/master' into gtk4-prep-hdy-tab…
colinkiama Mar 21, 2024
53bbcbd
Duplicated tabs now open in tab next to original tab
colinkiama Mar 22, 2024
fd1ba1e
Dragging file into add-tab button in tab bar, opens the file in a new…
colinkiama Mar 22, 2024
ad52339
Tab icon is set when init_tab method is called in Document.vala
colinkiama Mar 22, 2024
f7570ce
Rename on_doc_attached to on_doc_added.
colinkiama Mar 22, 2024
59a38c6
fix: Tab Bar background colour follows the solarized light theme
colinkiama Mar 28, 2024
d4b8502
Merge remote-tracking branch 'upstream/master' into gtk4-prep-hdy-tab…
colinkiama Mar 28, 2024
943afc4
Tab History button now allows you to reopen closed tabs
colinkiama Mar 29, 2024
4fa0bb8
Items in tab history button menu are sorted from newest to oldest
colinkiama Mar 29, 2024
4d30d98
Move existing tab in tab history to the top if it was last closed.
colinkiama Mar 29, 2024
dbb17be
Limit max tab history items to 20
colinkiama Mar 29, 2024
68e47b6
`close_document()` method in DocumentView now closes the current tab …
colinkiama Mar 30, 2024
ec77a8c
Merge branch 'master' into colinkiama/gtk4-prep-hdy-tab-view
zeebok May 18, 2024
f344baf
Merge branch 'master' into colinkiama/gtk4-prep-hdy-tab-view
danirabbit May 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/fuzzy-search/fuzzy-search.vala
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class Scratch.Plugins.FuzzySearch: Peas.ExtensionBase, Peas.Activatable {
/* <Alt>f shows fuzzy search dialog */
switch (Gdk.keyval_to_upper (keyval)) {
case ACCEL_KEY:
if (state == ACCEL_MODTYPE) {
if ((state & ACCEL_MODTYPE) == ACCEL_MODTYPE) {
fuzzy_find ();
return true;
}
Expand Down
38 changes: 34 additions & 4 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ namespace Scratch {
public const string ACTION_SORT_LINES = "action_sort_lines";
public const string ACTION_NEW_TAB = "action_new_tab";
public const string ACTION_NEW_FROM_CLIPBOARD = "action_new_from_clipboard";
public const string ACTION_DUPLICATE_TAB = "action_duplicate_tab";
public const string ACTION_PREFERENCES = "preferences";
public const string ACTION_UNDO = "action_undo";
public const string ACTION_REDO = "action_redo";
Expand Down Expand Up @@ -98,6 +99,8 @@ namespace Scratch {
public const string ACTION_CLEAR_LINES = "action_clear_lines";
public const string ACTION_NEW_BRANCH = "action_new_branch";
public const string ACTION_CLOSE_TAB = "action_close_tab";
public const string ACTION_CLOSE_TABS_TO_RIGHT = "action_close_tabs_to_right";
public const string ACTION_CLOSE_OTHER_TABS = "action_close_other_tabs";
public const string ACTION_CLOSE_PROJECT_DOCS = "action_close_project_docs";
public const string ACTION_HIDE_PROJECT_DOCS = "action_hide_project_docs";
public const string ACTION_RESTORE_PROJECT_DOCS = "action_restore_project_docs";
Expand Down Expand Up @@ -128,6 +131,7 @@ namespace Scratch {
{ ACTION_SORT_LINES, action_sort_lines },
{ ACTION_NEW_TAB, action_new_tab },
{ ACTION_NEW_FROM_CLIPBOARD, action_new_tab_from_clipboard },
{ ACTION_DUPLICATE_TAB, action_duplicate_tab },
{ ACTION_PREFERENCES, action_preferences },
{ ACTION_UNDO, action_undo },
{ ACTION_REDO, action_redo },
Expand All @@ -149,7 +153,9 @@ namespace Scratch {
{ ACTION_PREVIOUS_TAB, action_previous_tab },
{ ACTION_CLEAR_LINES, action_clear_lines },
{ ACTION_NEW_BRANCH, action_new_branch, "s" },
{ ACTION_CLOSE_TAB, action_close_tab, "s"},
{ ACTION_CLOSE_TAB, action_close_tab, "s" },
{ ACTION_CLOSE_TABS_TO_RIGHT, action_close_tabs_to_right },
{ ACTION_CLOSE_OTHER_TABS, action_close_other_tabs },
{ ACTION_HIDE_PROJECT_DOCS, action_hide_project_docs, "s"},
{ ACTION_CLOSE_PROJECT_DOCS, action_close_project_docs, "s"},
{ ACTION_RESTORE_PROJECT_DOCS, action_restore_project_docs, "s"}
Expand Down Expand Up @@ -206,6 +212,7 @@ namespace Scratch {
action_accelerators.set (ACTION_TOGGLE_OUTLINE, "<Alt>backslash");
action_accelerators.set (ACTION_NEXT_TAB, "<Control>Tab");
action_accelerators.set (ACTION_NEXT_TAB, "<Control>Page_Down");
action_accelerators.set (ACTION_CLOSE_TAB + "::", "<Control>w");
action_accelerators.set (ACTION_PREVIOUS_TAB, "<Control><Shift>Tab");
action_accelerators.set (ACTION_PREVIOUS_TAB, "<Control>Page_Up");
action_accelerators.set (ACTION_CLEAR_LINES, "<Control>K"); //Geany
Expand Down Expand Up @@ -586,9 +593,8 @@ namespace Scratch {
update_find_actions ();
});

document_view.tab_removed.connect ((tab) => {
document_view.tab_removed.connect ((doc) => {
update_find_actions ();
var doc = (Scratch.Services.Document)tab;
var selected_item = (Scratch.FolderManager.Item?)(folder_manager_view.selected);
if (selected_item != null && selected_item.file.file.equal (doc.file)) {
// Do not leave removed tab selected
Expand Down Expand Up @@ -1063,7 +1069,19 @@ namespace Scratch {
}

private void action_close_tab (SimpleAction action, Variant? param) {
var close_path = get_target_path_for_actions (param);
string close_path = "";
if (param != null) {
close_path = param.get_string ();
}

if (close_path == "") {
var doc = get_current_document ();
if (doc != null) {
document_view.close_document (doc);
}
return;
}

unowned var docs = document_view.docs;
docs.foreach ((doc) => {
if (doc.file.get_path () == close_path) {
Expand All @@ -1072,6 +1090,18 @@ namespace Scratch {
});
}

private void action_duplicate_tab () {
document_view.duplicate_tab ();
}

private void action_close_tabs_to_right () {
document_view.close_tabs_to_right ();
}

private void action_close_other_tabs () {
document_view.close_other_tabs ();
}

private void action_hide_project_docs (SimpleAction action, Variant? param) {
close_project_docs (get_target_path_for_actions (param), true);
}
Expand Down