Skip to content

Commit

Permalink
feat: add toggle pano item to panel menu
Browse files Browse the repository at this point in the history
  • Loading branch information
oae committed Sep 11, 2022
1 parent e317d4c commit bd9a5c7
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 17 deletions.
8 changes: 6 additions & 2 deletions resources/po/ar.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ msgid "Clear"
msgstr "امحُ"

#: src/components/indicator/clearHistoryDialog.ts:33
#: src/components/indicator/settingsMenu.ts:60
#: src/components/indicator/settingsMenu.ts:68
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "امحُ السجل التاريخي"
Expand All @@ -24,10 +24,14 @@ msgid "Are you sure you want to clear history?"
msgstr "أمتأكد من رغبتك بمحوِ السجل التاريخي؟"

#: src/components/indicator/settingsMenu.ts:44
msgid "Toggle Pano"
msgstr ""

#: src/components/indicator/settingsMenu.ts:52
msgid "Incognito Mode"
msgstr ""

#: src/components/indicator/settingsMenu.ts:67
#: src/components/indicator/settingsMenu.ts:75
msgid "Settings"
msgstr ""

Expand Down
8 changes: 6 additions & 2 deletions resources/po/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ msgid "Clear"
msgstr "Clear"

#: src/components/indicator/clearHistoryDialog.ts:33
#: src/components/indicator/settingsMenu.ts:60
#: src/components/indicator/settingsMenu.ts:68
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "Clear History"
Expand All @@ -24,10 +24,14 @@ msgid "Are you sure you want to clear history?"
msgstr "Are you sure you want to clear history?"

#: src/components/indicator/settingsMenu.ts:44
msgid "Toggle Pano"
msgstr "Toggle Pano"

#: src/components/indicator/settingsMenu.ts:52
msgid "Incognito Mode"
msgstr "Incognito Mode"

#: src/components/indicator/settingsMenu.ts:67
#: src/components/indicator/settingsMenu.ts:75
msgid "Settings"
msgstr "Settings"

Expand Down
8 changes: 6 additions & 2 deletions resources/po/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ msgid "Clear"
msgstr "Vider"

#: src/components/indicator/clearHistoryDialog.ts:33
#: src/components/indicator/settingsMenu.ts:60
#: src/components/indicator/settingsMenu.ts:68
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "Vider l'historique"
Expand All @@ -24,10 +24,14 @@ msgid "Are you sure you want to clear history?"
msgstr "Êtes-vous sûr de vouloir vider l'historique ?"

#: src/components/indicator/settingsMenu.ts:44
msgid "Toggle Pano"
msgstr ""

#: src/components/indicator/settingsMenu.ts:52
msgid "Incognito Mode"
msgstr ""

#: src/components/indicator/settingsMenu.ts:67
#: src/components/indicator/settingsMenu.ts:75
msgid "Settings"
msgstr ""

Expand Down
8 changes: 6 additions & 2 deletions resources/po/hr.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ msgid "Clear"
msgstr "Ukloni"

#: src/components/indicator/clearHistoryDialog.ts:33
#: src/components/indicator/settingsMenu.ts:60
#: src/components/indicator/settingsMenu.ts:68
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "Ukloni povijest"
Expand All @@ -24,10 +24,14 @@ msgid "Are you sure you want to clear history?"
msgstr "Sigurno želite ukloniti povijest?"

#: src/components/indicator/settingsMenu.ts:44
msgid "Toggle Pano"
msgstr ""

#: src/components/indicator/settingsMenu.ts:52
msgid "Incognito Mode"
msgstr ""

#: src/components/indicator/settingsMenu.ts:67
#: src/components/indicator/settingsMenu.ts:75
msgid "Settings"
msgstr ""

Expand Down
8 changes: 6 additions & 2 deletions resources/po/oc.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ msgid "Clear"
msgstr "Escafar"

#: src/components/indicator/clearHistoryDialog.ts:33
#: src/components/indicator/settingsMenu.ts:60
#: src/components/indicator/settingsMenu.ts:68
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "Escafar l’istoric"
Expand All @@ -24,10 +24,14 @@ msgid "Are you sure you want to clear history?"
msgstr "Volètz vertadièrament escafar l’istoric ?"

#: src/components/indicator/settingsMenu.ts:44
msgid "Toggle Pano"
msgstr ""

#: src/components/indicator/settingsMenu.ts:52
msgid "Incognito Mode"
msgstr ""

#: src/components/indicator/settingsMenu.ts:67
#: src/components/indicator/settingsMenu.ts:75
msgid "Settings"
msgstr ""

Expand Down
10 changes: 7 additions & 3 deletions resources/po/pano@elhan.io.pot
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ msgid "Clear"
msgstr ""

#: src/components/indicator/clearHistoryDialog.ts:33
#: src/components/indicator/settingsMenu.ts:60
#: src/components/indicator/settingsMenu.ts:68
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr ""
Expand Down Expand Up @@ -78,7 +78,7 @@ msgstr ""
msgid "History Length"
msgstr ""

#: src/components/indicator/settingsMenu.ts:44
#: src/components/indicator/settingsMenu.ts:52
msgid "Incognito Mode"
msgstr ""

Expand Down Expand Up @@ -112,7 +112,7 @@ msgstr ""
msgid "Select a shortcut"
msgstr ""

#: src/components/indicator/settingsMenu.ts:67
#: src/components/indicator/settingsMenu.ts:75
msgid "Settings"
msgstr ""

Expand All @@ -124,6 +124,10 @@ msgstr ""
msgid "Shows an indicator on top panel"
msgstr ""

#: src/components/indicator/settingsMenu.ts:44
msgid "Toggle Pano"
msgstr ""

#: src/components/searchBox.ts:32
msgid "Type to search"
msgstr ""
Expand Down
8 changes: 6 additions & 2 deletions resources/po/tr.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ msgid "Clear"
msgstr "Temizle"

#: src/components/indicator/clearHistoryDialog.ts:33
#: src/components/indicator/settingsMenu.ts:60
#: src/components/indicator/settingsMenu.ts:68
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "Geçmişi Temizle"
Expand All @@ -24,10 +24,14 @@ msgid "Are you sure you want to clear history?"
msgstr "Geçmişi temizlemek istediğine emin misiniz?"

#: src/components/indicator/settingsMenu.ts:44
msgid "Toggle Pano"
msgstr "Pano'yu Aç"

#: src/components/indicator/settingsMenu.ts:52
msgid "Incognito Mode"
msgstr "Gizli Mod"

#: src/components/indicator/settingsMenu.ts:67
#: src/components/indicator/settingsMenu.ts:75
msgid "Settings"
msgstr "Ayarlar"

Expand Down
10 changes: 9 additions & 1 deletion src/components/indicator/settingsMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class SettingsMenu extends PopupMenuButton {
private settings: Settings;
private incognitoChangeId: number;

constructor(onClear: () => Promise<void>) {
constructor(onClear: () => Promise<void>, onToggle: () => void) {
super(0.5, 'Pano Indicator', false);

this.settings = getCurrentExtensionSettings();
Expand All @@ -41,6 +41,14 @@ export class SettingsMenu extends PopupMenuButton {

this.add_child(icon);

const togglePanoItem = new PopupMenuItem(_('Toggle Pano'));
togglePanoItem.connect('activate', () => {
this.menu.close(false);
onToggle();
});
this.menu.addMenuItem(togglePanoItem);
this.menu.addMenuItem(new PopupSeparatorMenuItem());

const switchMenuItem = new PopupSwitchMenuItem(_('Incognito Mode'), this.settings.get_boolean('is-in-incognito'));

switchMenuItem.connect('toggled', (item) => {
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class PanoExtension {

createIndicator() {
if (this.settings.get_boolean('show-indicator')) {
this.settingsMenu = new SettingsMenu(this.clearHistory.bind(this));
this.settingsMenu = new SettingsMenu(this.clearHistory.bind(this), () => this.panoWindow.toggle());
addToStatusArea(this.settingsMenu);
}
}
Expand Down

0 comments on commit bd9a5c7

Please sign in to comment.