[gnome-characters/bilelmoussaoui/gtk4: 1/2] window: drop useless functions & simplify
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-characters/bilelmoussaoui/gtk4: 1/2] window: drop useless functions & simplify
- Date: Thu, 25 Nov 2021 08:50:08 +0000 (UTC)
commit 909fd4ce75887f1f1a24f45432fae311849c0c99
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Thu Nov 25 08:43:03 2021 +0100
window: drop useless functions & simplify
src/window.js | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
---
diff --git a/src/window.js b/src/window.js
index 6990a3d..c7292df 100644
--- a/src/window.js
+++ b/src/window.js
@@ -28,8 +28,6 @@
const { Adw, Gio, GLib, GObject, Gtk } = imports.gi;
const { CharacterDialog } = imports.characterDialog;
-const { gettext } = imports.gettext;
-
const Main = imports.main;
const Util = imports.util;
@@ -66,7 +64,7 @@ var MainWindow = GObject.registerClass({
if (row) {
this._sidebar.lastSelectedRow = row;
this.setPage(row);
- this._updateTitle(row.title);
+ this._windowTitle.title = row.title;
this._leaflet.navigate(Adw.NavigationDirection.FORWARD);
}
});
@@ -144,7 +142,7 @@ var MainWindow = GObject.registerClass({
set searchActive(v) {
if (v) {
this._sidebar.list.unselect_all();
- this._updateTitle(_('Search Result'));
+ this._windowTitle.title = _('Search Result');
} else {
this._sidebar.restoreSelection();
}
@@ -155,7 +153,7 @@ var MainWindow = GObject.registerClass({
let keywords = text === '' ? [] : text.split(/\s+/);
keywords = keywords.map(x => x.toUpperCase());
if (keywords !== this._searchKeywords) {
- this.cancelSearch();
+ this._charactersView.cancelSearch();
this._searchKeywords = keywords;
if (this._searchKeywords.length > 0)
this.searchByKeywords(this._searchKeywords);
@@ -190,15 +188,6 @@ var MainWindow = GObject.registerClass({
aboutDialog.show();
}
- _updateTitle(title) {
- this._windowTitle.title = gettext(title);
- }
-
- _character(action, v) {
- const uc = v.get_string()[0];
- this.addToRecent(uc);
- }
-
get maxRecentCharacters() {
return this._maxRecentCharacters;
}
@@ -221,10 +210,6 @@ var MainWindow = GObject.registerClass({
});
}
- cancelSearch() {
- this._charactersView.cancelSearch();
- }
-
setPage(pageRow) {
if (pageRow.name === 'recent') {
// always draw a baseline for recent view
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]