Skip to content

Commit

Permalink
fix: use borders instead of box-shadow. closes #53
Browse files Browse the repository at this point in the history
  • Loading branch information
oae committed Sep 11, 2022
1 parent 93641cd commit 7997bb8
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 80 deletions.
22 changes: 21 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,25 @@
"cmd": "#yarn run build:ts && yarn run shell:restart"
}
]
}
},
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#832460",
"activityBar.background": "#832460",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#121907",
"activityBarBadge.foreground": "#e7e7e7",
"commandCenter.border": "#e7e7e799",
"sash.hoverBorder": "#832460",
"statusBar.background": "#5b1943",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#832460",
"statusBarItem.remoteBackground": "#5b1943",
"statusBarItem.remoteForeground": "#e7e7e7",
"titleBar.activeBackground": "#5b1943",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#5b194399",
"titleBar.inactiveForeground": "#e7e7e799"
},
"peacock.color": "#5b1943"
}
8 changes: 4 additions & 4 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:68
#: src/components/indicator/settingsMenu.ts:67
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "امحُ السجل التاريخي"
Expand All @@ -23,15 +23,15 @@ msgstr "امحُ السجل التاريخي"
msgid "Are you sure you want to clear history?"
msgstr "أمتأكد من رغبتك بمحوِ السجل التاريخي؟"

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

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

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

Expand Down
8 changes: 4 additions & 4 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:68
#: src/components/indicator/settingsMenu.ts:67
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "Clear History"
Expand All @@ -23,15 +23,15 @@ msgstr "Clear History"
msgid "Are you sure you want to clear history?"
msgstr "Are you sure you want to clear history?"

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

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

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

Expand Down
8 changes: 4 additions & 4 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:68
#: src/components/indicator/settingsMenu.ts:67
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "Vider l'historique"
Expand All @@ -23,15 +23,15 @@ msgstr "Vider l'historique"
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
#: src/components/indicator/settingsMenu.ts:43
msgid "Toggle Pano"
msgstr ""

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

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

Expand Down
8 changes: 4 additions & 4 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:68
#: src/components/indicator/settingsMenu.ts:67
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "Ukloni povijest"
Expand All @@ -23,15 +23,15 @@ msgstr "Ukloni povijest"
msgid "Are you sure you want to clear history?"
msgstr "Sigurno želite ukloniti povijest?"

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

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

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

Expand Down
8 changes: 4 additions & 4 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:68
#: src/components/indicator/settingsMenu.ts:67
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "Escafar l’istoric"
Expand All @@ -23,15 +23,15 @@ msgstr "Escafar l’istoric"
msgid "Are you sure you want to clear history?"
msgstr "Volètz vertadièrament escafar l’istoric ?"

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

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

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

Expand Down
8 changes: 4 additions & 4 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:68
#: src/components/indicator/settingsMenu.ts:67
#: 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:52
#: src/components/indicator/settingsMenu.ts:51
msgid "Incognito Mode"
msgstr ""

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

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

Expand All @@ -128,7 +128,7 @@ msgstr ""
msgid "Shows an indicator on top panel"
msgstr ""

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

Expand Down
8 changes: 4 additions & 4 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:68
#: src/components/indicator/settingsMenu.ts:67
#: src/prefs/dangerZone/clearHistory.ts:11
msgid "Clear History"
msgstr "Geçmişi Temizle"
Expand All @@ -23,15 +23,15 @@ msgstr "Geçmişi Temizle"
msgid "Are you sure you want to clear history?"
msgstr "Geçmişi temizlemek istediğine emin misiniz?"

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

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

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

Expand Down
5 changes: 3 additions & 2 deletions src/components/colorPanoItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export class ColorPanoItem extends PanoItem {
y_expand: true,
y_align: ActorAlign.FILL,
x_align: ActorAlign.FILL,
style: `border-radius: 0px 0px 10px 10px; background-color: ${this.dbItem.content};`,
style_class: 'color-container',
style: `background-color: ${this.dbItem.content};`,
});

colorContainer.add_child(
Expand All @@ -27,7 +28,7 @@ export class ColorPanoItem extends PanoItem {
x_expand: true,
y_expand: true,
text: this.dbItem.content,
style: 'font-size: 16px; border-radius: 999px; background-color: black; color: white; padding: 10px',
style_class: 'color-label',
}),
);

Expand Down
3 changes: 1 addition & 2 deletions src/components/indicator/settingsMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ export class SettingsMenu extends PopupMenuButton {
gicon: icon_new_for_string(
`${getCurrentExtension().path}/icons/indicator${isInIncognito ? '-incognito' : ''}.svg`,
),
style: 'padding: 0px; margin: 0px;',
style_class: 'system-status-icon',
style_class: 'system-status-icon indicator-icon',
});

this.add_child(icon);
Expand Down
3 changes: 2 additions & 1 deletion src/components/linkPanoItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export class LinkPanoItem extends PanoItem {
y_expand: true,
y_align: ActorAlign.FILL,
x_align: ActorAlign.FILL,
style: `background-image: url(${imageFilePath}); background-size: cover; border-radius: 1px 1px 0px 0px;`,
style_class: 'image-container',
style: `background-image: url(${imageFilePath});`,
});

metaContainer.add_child(titleLabel);
Expand Down
37 changes: 0 additions & 37 deletions src/components/panoItem.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {
ActorAlign,
AnimationMode,
ButtonEvent,
EVENT_PROPAGATE,
EVENT_STOP,
Expand Down Expand Up @@ -42,7 +40,6 @@ export class PanoItem extends BoxLayout {
};

private header: PanoItemHeader;
private indicatorBox: BoxLayout;
private timeoutId: number | undefined;
protected body: BoxLayout;
public dbItem: DBItem;
Expand All @@ -58,16 +55,6 @@ export class PanoItem extends BoxLayout {
track_hover: true,
});

this.indicatorBox = new BoxLayout({
visible: true,
x_align: ActorAlign.CENTER,
y_align: ActorAlign.END,
height: 0,
width: 0,
translation_y: 5,
style: 'background: #1e66f5; border-radius: 999px; box-shadow: 0px 0px 2px 1px #1e66f5;',
});

this.dbItem = dbItem;

this.connect('key-focus-in', () => this.setSelected(true));
Expand Down Expand Up @@ -117,37 +104,14 @@ export class PanoItem extends BoxLayout {

this.add_child(this.header);
this.add_child(this.body);
this.add_child(this.indicatorBox);
}

private setSelected(selected: boolean) {
if (selected) {
this.add_style_pseudo_class('selected');
this.indicatorBox.ease({
height: 5,
width: 290,
duration: 150,
mode: AnimationMode.EASE_OUT_QUAD,
});
this.ease({
translation_y: -5,
duration: 150,
mode: AnimationMode.EASE_OUT_QUAD,
});
this.grab_key_focus();
} else {
this.remove_style_pseudo_class('selected');
this.indicatorBox.ease({
height: 0,
width: 0,
duration: 150,
mode: AnimationMode.EASE_OUT_QUAD,
});
this.ease({
translation_y: 0,
duration: 150,
mode: AnimationMode.EASE_OUT_QUAD,
});
}
}
override vfunc_key_press_event(event: KeyEvent): boolean {
Expand Down Expand Up @@ -176,7 +140,6 @@ export class PanoItem extends BoxLayout {
Source.remove(this.timeoutId);
}
this.header.destroy();
this.indicatorBox.destroy();
super.destroy();
}
}
Loading

0 comments on commit 7997bb8

Please sign in to comment.