Skip to content

Commit 71b2b56

Browse files
authored
Merge branch 'master' into jeremypw/SearchBar/cleanup
2 parents 7d7acd1 + 16a21ac commit 71b2b56

8 files changed

Lines changed: 83 additions & 33 deletions

File tree

data/Application.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ textview.scrubber {
4545
background-color: transparent;
4646
}
4747

48-
.fuzzy-item:focused,
48+
.fuzzy-item:focus,
4949
.fuzzy-item:hover {
5050
border-radius: 0.5rem;
5151
}
@@ -54,7 +54,7 @@ textview.scrubber {
5454
background-color: @theme_unfocused_selected_bg_color;
5555
}
5656

57-
.fuzzy-item:focused {
57+
.fuzzy-item:focus {
5858
background-color: @selected_bg_color;
5959
color: @selected_fg_color;
6060
}

po/extra/ru.po

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ msgstr ""
88
"Project-Id-Version: scratch\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2026-08-03 14:41+0000\n"
11-
"PO-Revision-Date: 2026-03-02 12:55+0000\n"
11+
"PO-Revision-Date: 2026-08-14 08:01+0000\n"
1212
"Last-Translator: кубик круглый <megarainbow29@gmail.com>\n"
13-
"Language-Team: Russian <https://l10n.elementaryos.org/projects/code/extra/ru/"
14-
">\n"
13+
"Language-Team: Russian <https://l10n.elementaryos.org/projects/code/extra/"
14+
"ru/>\n"
1515
"Language: ru\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
2020
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
21-
"X-Generator: Weblate 5.11.4\n"
21+
"X-Generator: Weblate 2026.5\n"
2222
"X-Launchpad-Export-Date: 2017-05-03 06:04+0000\n"
2323

2424
#: data/code.metainfo.xml.in:9
@@ -171,66 +171,82 @@ msgstr "Улучшения:"
171171

172172
#: data/code.metainfo.xml.in:90
173173
msgid "The sidebar can now be focused using a keyboard shortcut"
174-
msgstr ""
174+
msgstr "Фокусировка на боковой панели при помощи сочетания клавиш"
175175

176176
#: data/code.metainfo.xml.in:91
177177
msgid ""
178178
"Closing a second window by headerbar or shortcut only closes that window, "
179179
"saving its documents"
180180
msgstr ""
181+
"Закрытие второго окна из заголовка или сочетанием клавиш закрывает только "
182+
"это окно, сохраняя его документы"
181183

182184
#: data/code.metainfo.xml.in:92
183185
msgid "The system font is shown and can be selected in the Preferences dialog"
184-
msgstr ""
186+
msgstr "Системный шрифт теперь отображается в настройках и может быть выбран"
185187

186188
#: data/code.metainfo.xml.in:93
187189
msgid ""
188190
"Improved desktop consistency and contrast by using user accent color for "
189191
"selections"
190192
msgstr ""
193+
"Улучшена однородность и контрастность путём использования пользовательского "
194+
"акцентного цвета для выделения"
191195

192196
#: data/code.metainfo.xml.in:97
193197
msgid "Closing all windows by shortcut now correctly saves all documents"
194198
msgstr ""
199+
"Закрытие всех окон сочетанием клавиш теперь корректно сохраняет все документы"
195200

196201
#: data/code.metainfo.xml.in:98
197202
msgid ""
198203
"Filetypes excluded from stripping trailing whitespace are shown in the "
199204
"application menu"
200205
msgstr ""
206+
"Типы файлов, исключённые из удаления пробелов на конце строк, теперь "
207+
"отображаются в меню приложения"
201208

202209
#: data/code.metainfo.xml.in:99
203210
msgid "Stripping trailing whitespace now correctly excludes string literals"
204211
msgstr ""
212+
"Удаление пробелов на конце строк теперь корректно исключает строчные литералы"
205213

206214
#: data/code.metainfo.xml.in:100
207215
msgid "Fuzzy searching for project files now correctly searches active project"
208216
msgstr ""
217+
"Нечёткий поиск файлов проектов теперь корректно ищет по активному проекту"
209218

210219
#: data/code.metainfo.xml.in:121
211220
msgid ""
212221
"Trailing spaces are now removed when the document focuses out (subject to "
213222
"setting)"
214223
msgstr ""
224+
"Пробелы на конце строк теперь удаляются при потере фокуса на документе "
225+
"(настраиваемое поведение)"
215226

216227
#: data/code.metainfo.xml.in:122
217228
msgid "Focus following is implemented between textview and terminal pane"
218229
msgstr ""
230+
"Добавлено отслеживание фокусировки между текстовым окном и панелью терминала"
219231

220232
#: data/code.metainfo.xml.in:123
221233
msgid ""
222234
"A new dialog for branch actions (open, new) is implemented linked to hot-key "
223235
"Ctrl-B"
224236
msgstr ""
237+
"Новый диалог действий с ветками (создание, переключение) добавлен по "
238+
"сочетанию клавиш Ctrl + B"
225239

226240
#: data/code.metainfo.xml.in:124
227241
msgid "It is now possible to create a new document from a template"
228-
msgstr ""
242+
msgstr "Добавлена возможность создания нового документа из шаблона"
229243

230244
#: data/code.metainfo.xml.in:128
231245
msgid ""
232246
"Restoring screen state no longer can get stuck always restoring full screen"
233247
msgstr ""
248+
"Восстановление состояния экрана больше не может застрять, каждый раз "
249+
"восстанавливая окно в полный экран"
234250

235251
#: data/code.metainfo.xml.in:142
236252
msgid ""
@@ -659,8 +675,8 @@ msgid ""
659675
"Terminal, Symbol outline, and the Strip Trailing Whitespace plugins are now "
660676
"part of the main codebase"
661677
msgstr ""
662-
"Терминал, обводка символов и убирание пробелов в конце строк теперь входят в "
663-
"основной код приложения"
678+
"Плагины «Терминал», «Структура символов» и «Удаление пробелов на конце строк"
679+
"» теперь входят в основной код приложения"
664680

665681
#: data/code.metainfo.xml.in:431
666682
msgid ""

po/extra/zh_TW.po

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: scratch\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2026-08-03 14:41+0000\n"
11-
"PO-Revision-Date: 2026-08-03 14:41+0000\n"
11+
"PO-Revision-Date: 2026-08-16 12:01+0000\n"
1212
"Last-Translator: Kisaragi Hiu <mail@kisaragi-hiu.com>\n"
1313
"Language-Team: Chinese (Traditional Han script) <https://"
1414
"l10n.elementaryos.org/projects/code/extra/zh_TW/>\n"
@@ -186,40 +186,40 @@ msgstr "確保用快捷鍵關閉所有視窗時所有文件皆會正確儲存"
186186
msgid ""
187187
"Filetypes excluded from stripping trailing whitespace are shown in the "
188188
"application menu"
189-
msgstr ""
189+
msgstr "在應用程式選單裡面顯示已排除刪除行尾空白的檔案類型"
190190

191191
#: data/code.metainfo.xml.in:99
192192
msgid "Stripping trailing whitespace now correctly excludes string literals"
193-
msgstr ""
193+
msgstr "刪除行尾空白時修正成正確排除字串字面值"
194194

195195
#: data/code.metainfo.xml.in:100
196196
msgid "Fuzzy searching for project files now correctly searches active project"
197-
msgstr ""
197+
msgstr "專案檔案的模糊搜尋現在會正確搜尋作用中專案"
198198

199199
#: data/code.metainfo.xml.in:121
200200
msgid ""
201201
"Trailing spaces are now removed when the document focuses out (subject to "
202202
"setting)"
203-
msgstr ""
203+
msgstr "焦點離開文件時刪除行尾空白(依設定)"
204204

205205
#: data/code.metainfo.xml.in:122
206206
msgid "Focus following is implemented between textview and terminal pane"
207-
msgstr ""
207+
msgstr "實作在文字檢視與終端機面板之間的焦點跟隨"
208208

209209
#: data/code.metainfo.xml.in:123
210210
msgid ""
211211
"A new dialog for branch actions (open, new) is implemented linked to hot-key "
212212
"Ctrl-B"
213-
msgstr ""
213+
msgstr "新增用來進行分支動作(開啟、新增)的新對話框,預設快捷鍵 Ctrl-B"
214214

215215
#: data/code.metainfo.xml.in:124
216216
msgid "It is now possible to create a new document from a template"
217-
msgstr ""
217+
msgstr "新增從範本建立新文件的功能"
218218

219219
#: data/code.metainfo.xml.in:128
220220
msgid ""
221221
"Restoring screen state no longer can get stuck always restoring full screen"
222-
msgstr ""
222+
msgstr "修正回復畫面狀態時會一直卡在回復成全螢幕的問題"
223223

224224
#: data/code.metainfo.xml.in:142
225225
msgid ""

po/zh_TW.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgstr ""
77
"Project-Id-Version: scratch\n"
88
"Report-Msgid-Bugs-To: \n"
99
"POT-Creation-Date: 2026-08-03 14:41+0000\n"
10-
"PO-Revision-Date: 2026-08-03 14:41+0000\n"
10+
"PO-Revision-Date: 2026-08-16 12:01+0000\n"
1111
"Last-Translator: Kisaragi Hiu <mail@kisaragi-hiu.com>\n"
1212
"Language-Team: Chinese (Traditional Han script) <https://"
1313
"l10n.elementaryos.org/projects/code/code/zh_TW/>\n"
@@ -237,7 +237,7 @@ msgstr "儲存時刪除行尾空白"
237237

238238
#: src/Dialogs/PreferencesDialog.vala:29
239239
msgid "Except Plain Text, Markdown and YAML"
240-
msgstr ""
240+
msgstr "除了純文字、Markdown 及 YAML 以外"
241241

242242
#: src/Dialogs/PreferencesDialog.vala:32
243243
msgid "Smart cut/copy lines"
@@ -454,7 +454,7 @@ msgstr "空白檔案"
454454

455455
#: src/FolderManager/FolderItem.vala:238
456456
msgid "…too many templates"
457-
msgstr ""
457+
msgstr "…太多範本了"
458458

459459
#: src/FolderManager/FolderItem.vala:241
460460
msgid "Templates"

src/MainWindow.vala

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ public class Scratch.MainWindow : Hdy.Window {
228228
action_accelerators.set (ACTION_NEXT_TAB, "<Control>Tab");
229229
action_accelerators.set (ACTION_NEXT_TAB, "<Control>Page_Down");
230230
action_accelerators.set (ACTION_CLOSE_TAB + "::", "<Control>w");
231+
action_accelerators.set (ACTION_CLOSE_OTHER_TABS, "<Shift><Control>w");
231232
action_accelerators.set (ACTION_PREVIOUS_TAB, "<Control><Shift>Tab");
232233
action_accelerators.set (ACTION_PREVIOUS_TAB, "<Control>Page_Up");
233234
action_accelerators.set (ACTION_CLEAR_LINES, "<Control>K"); //Geany
@@ -492,6 +493,10 @@ public class Scratch.MainWindow : Hdy.Window {
492493
visible = false
493494
};
494495

496+
terminal.terminal.notify["is-focus"].connect (() => {
497+
on_terminal_focus_change ();
498+
});
499+
495500
var view_grid = new Gtk.Grid () {
496501
orientation = Gtk.Orientation.VERTICAL
497502
};
@@ -619,6 +624,27 @@ public class Scratch.MainWindow : Hdy.Window {
619624
set_widgets_sensitive (false);
620625
}
621626

627+
private bool on_terminal_focus_change () {
628+
var focused = terminal.terminal.is_focus;
629+
//<Control>r +- shift
630+
Utils.action_from_group (ACTION_SHOW_REPLACE, actions).set_enabled (!focused);
631+
Utils.action_from_group (ACTION_RESTORE_PROJECT_DOCS, actions).set_enabled (!focused);
632+
//<Control>z +- shift
633+
Utils.action_from_group (ACTION_UNDO, actions).set_enabled (!focused);
634+
Utils.action_from_group (ACTION_REDO, actions).set_enabled (!focused);
635+
636+
//<Control>u
637+
Utils.action_from_group (ACTION_TO_UPPER_CASE, actions).set_enabled (!focused);
638+
639+
//<Control>k +- shift
640+
Utils.action_from_group (ACTION_DUPLICATE_TAB, actions).set_enabled (!focused);
641+
Utils.action_from_group (ACTION_CLEAR_LINES, actions).set_enabled (!focused);
642+
643+
//<Control>l
644+
Utils.action_from_group (ACTION_TO_LOWER_CASE, actions).set_enabled (!focused);
645+
return false;
646+
}
647+
622648
private void open_binary (File file) {
623649
if (!file.query_exists ()) {
624650
return;

src/Services/Document.vala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ namespace Scratch.Services {
286286
this.source_view.buffer.create_tag ("highlight_search_all", "background", "yellow", null);
287287

288288
this.source_view.notify["is-focus"].connect (() => {
289-
return_if_fail (!locked);
289+
if (locked) {
290+
return;
291+
}
292+
290293
if (source_view.is_focus) {
291294
if (!is_file_temporary) {
292295
check_undoable_actions ();

src/Widgets/ChooseProjectButton.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ public class Code.ChooseProjectButton : Gtk.Bin {
124124
}
125125
});
126126

127-
menu_button.activate.connect (() => {
127+
menu_button.toggled.connect (() => {
128128
if (menu_button.active) {
129129
unowned var active_path = Scratch.Services.GitManager.get_instance ().active_project_path;
130130
foreach (var child in project_listbox.get_children ()) {
131131
var project_row = ((ProjectRow) child);
132132
// All paths must not end in directory separator so can be compared directly
133-
project_row.active = active_path == project_row.project_path;
133+
project_row.is_active_project = active_path == project_row.project_path;
134134
}
135135
}
136136
});
@@ -161,7 +161,7 @@ public class Code.ChooseProjectButton : Gtk.Bin {
161161

162162
public class ProjectRow : Gtk.ListBoxRow {
163163
private Gtk.CheckButton check_button;
164-
public bool active {
164+
public bool is_active_project {
165165
get {
166166
return check_button.active;
167167
}

src/Widgets/FormatBar.vala

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,16 +270,21 @@ public class Code.FormatBar : Gtk.Box {
270270
goto_entry.text = "%d.%d".printf (line, iter.get_line_offset () + 1);
271271
}
272272

273-
public void set_document (Scratch.Services.Document doc) {
274-
if (this.doc != null) {
275-
this.doc.source_view.buffer.notify["cursor-position"].disconnect (format_line_header);
273+
public void set_document (Scratch.Services.Document set_doc) requires (set_doc != null) {
274+
if (doc != null) {
275+
doc.source_view.notify["language"].disconnect (update_current_lang);
276+
doc.source_view.buffer.notify["cursor-position"].disconnect (format_line_header);
276277
}
277278

278-
this.doc = doc;
279+
doc = set_doc;
280+
281+
doc.source_view.notify["language"].connect (update_current_lang);
279282
update_current_lang ();
280-
format_tab_header_from_global_settings ();
283+
284+
doc.source_view.buffer.notify["cursor-position"].connect (format_line_header);
281285
format_line_header ();
282-
this.doc.source_view.buffer.notify["cursor-position"].connect (format_line_header);
286+
287+
format_tab_header_from_global_settings ();
283288
}
284289

285290
public void set_insert_spaces_instead_of_tabs (bool use_spaces) {

0 commit comments

Comments
 (0)