From ef3293ab6ac64970bb6fa24be33dbe606bbd344e Mon Sep 17 00:00:00 2001 From: SomberNight Date: Fri, 30 Apr 2021 16:44:32 +0200 Subject: [PATCH] kivy: relocate atlas so it can be made a submodule later --- .gitignore | 5 ++--- contrib/android/Makefile | 2 +- electrum/gui/kivy/main.kv | 10 +++++----- electrum/gui/kivy/main_window.py | 6 +++--- electrum/gui/kivy/theming/atlas/.gitkeep | 0 electrum/gui/kivy/uix/dialogs/installwizard.py | 10 +++++----- electrum/gui/kivy/uix/dialogs/invoice_dialog.py | 4 ++-- electrum/gui/kivy/uix/dialogs/label_dialog.py | 4 ++-- .../gui/kivy/uix/dialogs/lightning_open_channel.py | 8 ++++---- electrum/gui/kivy/uix/dialogs/password_dialog.py | 4 ++-- electrum/gui/kivy/uix/dialogs/qr_dialog.py | 2 +- electrum/gui/kivy/uix/dialogs/qr_scanner.py | 2 +- electrum/gui/kivy/uix/dialogs/request_dialog.py | 4 ++-- electrum/gui/kivy/uix/dialogs/tx_dialog.py | 2 +- electrum/gui/kivy/uix/screens.py | 4 ++-- electrum/gui/kivy/uix/ui_screens/history.kv | 2 +- electrum/gui/kivy/uix/ui_screens/receive.kv | 8 ++++---- electrum/gui/kivy/uix/ui_screens/send.kv | 12 ++++++------ 18 files changed, 44 insertions(+), 45 deletions(-) create mode 100644 electrum/gui/kivy/theming/atlas/.gitkeep diff --git a/.gitignore b/.gitignore index 62cc1bcd7..ad33c954a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,9 +20,8 @@ electrum_data .DS_Store # icons -electrum/gui/kivy/theming/light-0.png -electrum/gui/kivy/theming/light-1.png -electrum/gui/kivy/theming/light.atlas +electrum/gui/kivy/theming/atlas/*.png +electrum/gui/kivy/theming/atlas/*.atlas # tests/tox .tox/ diff --git a/contrib/android/Makefile b/contrib/android/Makefile index a0651f469..b5ddbc34c 100644 --- a/contrib/android/Makefile +++ b/contrib/android/Makefile @@ -6,7 +6,7 @@ PYTHON = python3 theming: #bash -c 'for i in network lightning; do convert -background none theming/light/$i.{svg,png}; done' - $(PYTHON) -m kivy.atlas ../../electrum/gui/kivy/theming/light 1024 ../../electrum/gui/kivy/theming/light/*.png + $(PYTHON) -m kivy.atlas ../../electrum/gui/kivy/theming/atlas/light 1024 ../../electrum/gui/kivy/theming/light/*.png prepare: # running pre build setup @cp buildozer.spec ../../buildozer.spec diff --git a/electrum/gui/kivy/main.kv b/electrum/gui/kivy/main.kv index cd5ba1079..d1ba7ad56 100644 --- a/electrum/gui/kivy/main.kv +++ b/electrum/gui/kivy/main.kv @@ -233,7 +233,7 @@ Color: rgba: 0.192, .498, 0.745, 1 BorderImage: - source: f'atlas://{KIVY_GUI_PATH}/theming/light/card_bottom' + source: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/card_bottom' size: self.size pos: self.pos @@ -247,7 +247,7 @@ Color: rgba: 0.192, .498, 0.745, 1 BorderImage: - source: f'atlas://{KIVY_GUI_PATH}/theming/light/card_bottom' + source: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/card_bottom' size: self.size pos: self.pos @@ -260,7 +260,7 @@ Color: rgba: 0.192, .498, 0.745, 1 BorderImage: - source: f'atlas://{KIVY_GUI_PATH}/theming/light/card_bottom' + source: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/card_bottom' size: self.size pos: self.pos @@ -348,8 +348,8 @@ valign: 'middle' bold: True font_size: '12.5sp' - background_normal: f'atlas://{KIVY_GUI_PATH}/theming/light/tab_btn' - background_down: f'atlas://{KIVY_GUI_PATH}/theming/light/tab_btn_pressed' + background_normal: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/tab_btn' + background_down: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/tab_btn_pressed' : diff --git a/electrum/gui/kivy/main_window.py b/electrum/gui/kivy/main_window.py index 707d40775..d12c93cd9 100644 --- a/electrum/gui/kivy/main_window.py +++ b/electrum/gui/kivy/main_window.py @@ -1028,7 +1028,7 @@ class ElectrumWindow(App, Logger): self.qr_dialog(label.name, label.data, show_text_with_qr) def show_error(self, error, width='200dp', pos=None, arrow_pos=None, - exit=False, icon=f'atlas://{KIVY_GUI_PATH}/theming/light/error', duration=0, + exit=False, icon=f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/error', duration=0, modal=False): ''' Show an error Message Bubble. ''' @@ -1040,7 +1040,7 @@ class ElectrumWindow(App, Logger): exit=False, duration=0, modal=False): ''' Show an Info Message Bubble. ''' - self.show_error(error, icon=f'atlas://{KIVY_GUI_PATH}/theming/light/important', + self.show_error(error, icon=f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/important', duration=duration, modal=modal, exit=exit, pos=pos, arrow_pos=arrow_pos) @@ -1081,7 +1081,7 @@ class ElectrumWindow(App, Logger): info_bubble.show_arrow = False img.allow_stretch = True info_bubble.dim_background = True - info_bubble.background_image = f'atlas://{KIVY_GUI_PATH}/theming/light/card' + info_bubble.background_image = f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/card' else: info_bubble.fs = False info_bubble.icon = icon diff --git a/electrum/gui/kivy/theming/atlas/.gitkeep b/electrum/gui/kivy/theming/atlas/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/electrum/gui/kivy/uix/dialogs/installwizard.py b/electrum/gui/kivy/uix/dialogs/installwizard.py index 0debfa417..72fd896ad 100644 --- a/electrum/gui/kivy/uix/dialogs/installwizard.py +++ b/electrum/gui/kivy/uix/dialogs/installwizard.py @@ -44,8 +44,8 @@ Builder.load_string(''' background_color: (1, 1, 1, 1) if self.focus else (0.454, 0.698, 0.909, 1) foreground_color: (0.31, 0.31, 0.31, 1) if self.focus else (0.835, 0.909, 0.972, 1) hint_text_color: self.foreground_color - background_active: f'atlas://{KIVY_GUI_PATH}/theming/light/create_act_text_active' - background_normal: f'atlas://{KIVY_GUI_PATH}/theming/light/create_act_text_active' + background_active: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/create_act_text_active' + background_normal: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/create_act_text_active' size_hint_y: None height: '48sp' @@ -313,7 +313,7 @@ Builder.load_string(''' font_size: '18dp' text_size: self.width - dp(24), self.height - dp(12) color: .1, .1, .1, 1 - background_normal: f'atlas://{KIVY_GUI_PATH}/theming/light/white_bg_round_top' + background_normal: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/white_bg_round_top' background_down: self.background_normal size_hint_y: None @@ -341,7 +341,7 @@ Builder.load_string(''' height: '30dp' width: '30dp' size_hint: 1, None - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/gear' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/gear' on_release: root.options_dialog() if root.options_dialog else None @@ -475,7 +475,7 @@ Builder.load_string(''' id: scan height: '48sp' on_release: root.scan_xpub() - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/camera' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/camera' size_hint: 1, None WizardButton: text: _('Paste') diff --git a/electrum/gui/kivy/uix/dialogs/invoice_dialog.py b/electrum/gui/kivy/uix/dialogs/invoice_dialog.py index dcb28c87c..f6ad2b6c0 100644 --- a/electrum/gui/kivy/uix/dialogs/invoice_dialog.py +++ b/electrum/gui/kivy/uix/dialogs/invoice_dialog.py @@ -70,12 +70,12 @@ Builder.load_string(''' text: _('Delete') on_release: root.delete_dialog() IconButton: - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/copy' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/copy' size_hint: 0.5, None height: '48dp' on_release: root.copy_to_clipboard() IconButton: - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/share' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/share' size_hint: 0.5, None height: '48dp' on_release: root.do_share() diff --git a/electrum/gui/kivy/uix/dialogs/label_dialog.py b/electrum/gui/kivy/uix/dialogs/label_dialog.py index 490dc5e43..9e9428645 100644 --- a/electrum/gui/kivy/uix/dialogs/label_dialog.py +++ b/electrum/gui/kivy/uix/dialogs/label_dialog.py @@ -23,8 +23,8 @@ Builder.load_string(''' pos_hint: {'center_y':.5} text:'' multiline: False - background_normal: f'atlas://{KIVY_GUI_PATH}/theming/light/tab_btn' - background_active: f'atlas://{KIVY_GUI_PATH}/theming/light/textinput_active' + background_normal: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/tab_btn' + background_active: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/textinput_active' hint_text_color: self.foreground_color foreground_color: 1, 1, 1, 1 font_size: '16dp' diff --git a/electrum/gui/kivy/uix/dialogs/lightning_open_channel.py b/electrum/gui/kivy/uix/dialogs/lightning_open_channel.py index 8b234ccbc..3383558f7 100644 --- a/electrum/gui/kivy/uix/dialogs/lightning_open_channel.py +++ b/electrum/gui/kivy/uix/dialogs/lightning_open_channel.py @@ -45,7 +45,7 @@ Builder.load_string(''' size_hint: 1, None height: blue_bottom.item_height Image: - source: f'atlas://{KIVY_GUI_PATH}/theming/light/globe' + source: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/globe' size_hint: None, None size: '22dp', '22dp' pos_hint: {'center_y': .5} @@ -59,7 +59,7 @@ Builder.load_string(''' size_hint: 1, None height: blue_bottom.item_height Image: - source: f'atlas://{KIVY_GUI_PATH}/theming/light/calculator' + source: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/calculator' size_hint: None, None size: '22dp', '22dp' pos_hint: {'center_y': .5} @@ -72,13 +72,13 @@ Builder.load_string(''' size_hint: 1, None height: '48dp' IconButton: - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/copy' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/copy' size_hint: 0.5, None height: '48dp' on_release: s.do_paste() disabled: not app.use_gossip IconButton: - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/camera' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/camera' size_hint: 0.5, None height: '48dp' on_release: app.scan_qr(on_complete=s.on_qr) diff --git a/electrum/gui/kivy/uix/dialogs/password_dialog.py b/electrum/gui/kivy/uix/dialogs/password_dialog.py index 834ce4965..93df92547 100644 --- a/electrum/gui/kivy/uix/dialogs/password_dialog.py +++ b/electrum/gui/kivy/uix/dialogs/password_dialog.py @@ -51,7 +51,7 @@ Builder.load_string(''' IconButton: size_hint: 0.15, None height: '40dp' - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/btn_create_account' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/btn_create_account' on_release: root.select_file() disabled: root.hide_wallet_label or root.is_change opacity: 0 if root.hide_wallet_label or root.is_change else 1 @@ -85,7 +85,7 @@ Builder.load_string(''' IconButton: height: '40dp' size_hint: 0.15, None - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/eye1' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/eye1' icon_size: '40dp' on_release: textinput_generic_password.password = False if textinput_generic_password.password else True diff --git a/electrum/gui/kivy/uix/dialogs/qr_dialog.py b/electrum/gui/kivy/uix/dialogs/qr_dialog.py index 28ef22495..2f3336285 100644 --- a/electrum/gui/kivy/uix/dialogs/qr_dialog.py +++ b/electrum/gui/kivy/uix/dialogs/qr_dialog.py @@ -50,7 +50,7 @@ Builder.load_string(''' on_release: root.copy_to_clipboard() IconButton: - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/share' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/share' size_hint: 0.6, None height: '48dp' on_release: root.do_share() diff --git a/electrum/gui/kivy/uix/dialogs/qr_scanner.py b/electrum/gui/kivy/uix/dialogs/qr_scanner.py index d89c15880..fb5ace999 100644 --- a/electrum/gui/kivy/uix/dialogs/qr_scanner.py +++ b/electrum/gui/kivy/uix/dialogs/qr_scanner.py @@ -35,7 +35,7 @@ Builder.load_string(''' #separator_color: .89, .89, .89, 1 #separator_height: '1.2dp' #title_color: .437, .437, .437, 1 - #background: f'atlas://{KIVY_GUI_PATH}/theming/light/dialog' + #background: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/dialog' on_activate: qrscr.start() qrscr.size = self.size diff --git a/electrum/gui/kivy/uix/dialogs/request_dialog.py b/electrum/gui/kivy/uix/dialogs/request_dialog.py index 54a6ab338..151fde96f 100644 --- a/electrum/gui/kivy/uix/dialogs/request_dialog.py +++ b/electrum/gui/kivy/uix/dialogs/request_dialog.py @@ -69,12 +69,12 @@ Builder.load_string(''' text: _('Delete') on_release: root.delete_dialog() IconButton: - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/copy' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/copy' size_hint: 0.5, None height: '48dp' on_release: root.copy_to_clipboard() IconButton: - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/share' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/share' size_hint: 0.5, None height: '48dp' on_release: root.do_share() diff --git a/electrum/gui/kivy/uix/dialogs/tx_dialog.py b/electrum/gui/kivy/uix/dialogs/tx_dialog.py index 80d55c395..0d939244e 100644 --- a/electrum/gui/kivy/uix/dialogs/tx_dialog.py +++ b/electrum/gui/kivy/uix/dialogs/tx_dialog.py @@ -102,7 +102,7 @@ Builder.load_string(''' IconButton: size_hint: 0.5, None height: '48dp' - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/qrcode' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/qrcode' on_release: root.show_qr() Button: size_hint: 0.5, None diff --git a/electrum/gui/kivy/uix/screens.py b/electrum/gui/kivy/uix/screens.py index 85bfba9b9..e33f7ee30 100644 --- a/electrum/gui/kivy/uix/screens.py +++ b/electrum/gui/kivy/uix/screens.py @@ -131,7 +131,7 @@ class HistoryScreen(CScreen): if is_lightning: status = 0 status_str = 'unconfirmed' if timestamp is None else format_time(int(timestamp)) - icon = f'atlas://{KIVY_GUI_PATH}/theming/light/lightning' + icon = f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/lightning' message = tx_item['label'] fee_msat = tx_item['fee_msat'] fee = int(fee_msat/1000) if fee_msat else None @@ -143,7 +143,7 @@ class HistoryScreen(CScreen): conf=tx_item['confirmations'], timestamp=tx_item['timestamp']) status, status_str = self.app.wallet.get_tx_status(tx_hash, tx_mined_info) - icon = f'atlas://{KIVY_GUI_PATH}/theming/light/' + TX_ICONS[status] + icon = f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/' + TX_ICONS[status] message = tx_item['label'] or tx_hash fee = tx_item['fee_sat'] fee_text = '' if fee is None else 'fee: %d sat'%fee diff --git a/electrum/gui/kivy/uix/ui_screens/history.kv b/electrum/gui/kivy/uix/ui_screens/history.kv index 930f09864..146a01374 100644 --- a/electrum/gui/kivy/uix/ui_screens/history.kv +++ b/electrum/gui/kivy/uix/ui_screens/history.kv @@ -16,7 +16,7 @@ - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/important' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/important' message: '' fee_text: '' is_mine: True diff --git a/electrum/gui/kivy/uix/ui_screens/receive.kv b/electrum/gui/kivy/uix/ui_screens/receive.kv index 5c8e123fa..e2d43cd06 100644 --- a/electrum/gui/kivy/uix/ui_screens/receive.kv +++ b/electrum/gui/kivy/uix/ui_screens/receive.kv @@ -86,7 +86,7 @@ height: blue_bottom.item_height spacing: '5dp' Image: - source: f'atlas://{KIVY_GUI_PATH}/theming/light/lightning' if root.is_lightning else f'atlas://{KIVY_GUI_PATH}/theming/light/globe' + source: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/lightning' if root.is_lightning else f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/globe' size_hint: None, None size: '22dp', '22dp' pos_hint: {'center_y': .5} @@ -103,7 +103,7 @@ height: blue_bottom.item_height spacing: '5dp' Image: - source: f'atlas://{KIVY_GUI_PATH}/theming/light/calculator' + source: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/calculator' opacity: 0.7 size_hint: None, None size: '22dp', '22dp' @@ -123,7 +123,7 @@ height: blue_bottom.item_height spacing: '5dp' Image: - source: f'atlas://{KIVY_GUI_PATH}/theming/light/pen' + source: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/pen' size_hint: None, None size: '22dp', '22dp' pos_hint: {'center_y': .5} @@ -135,7 +135,7 @@ size_hint: 1, None height: '48dp' IconButton: - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/clock1' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/clock1' size_hint: 0.5, None height: '48dp' on_release: Clock.schedule_once(lambda dt: s.expiration_dialog(s)) diff --git a/electrum/gui/kivy/uix/ui_screens/send.kv b/electrum/gui/kivy/uix/ui_screens/send.kv index 0033d7be8..f866c28ba 100644 --- a/electrum/gui/kivy/uix/ui_screens/send.kv +++ b/electrum/gui/kivy/uix/ui_screens/send.kv @@ -86,7 +86,7 @@ height: blue_bottom.item_height spacing: '5dp' Image: - source: f'atlas://{KIVY_GUI_PATH}/theming/light/lightning' if root.is_lightning else f'atlas://{KIVY_GUI_PATH}/theming/light/globe' + source: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/lightning' if root.is_lightning else f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/globe' size_hint: None, None size: '22dp', '22dp' pos_hint: {'center_y': .5} @@ -103,7 +103,7 @@ height: blue_bottom.item_height spacing: '5dp' Image: - source: f'atlas://{KIVY_GUI_PATH}/theming/light/calculator' + source: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/calculator' opacity: 0.7 size_hint: None, None size: '22dp', '22dp' @@ -122,7 +122,7 @@ height: blue_bottom.item_height spacing: '5dp' Image: - source: f'atlas://{KIVY_GUI_PATH}/theming/light/pen' + source: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/pen' size_hint: None, None size: '22dp', '22dp' pos_hint: {'center_y': .5} @@ -137,14 +137,14 @@ IconButton: size_hint: 0.5, 1 on_release: s.do_save() - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/save' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/save' IconButton: size_hint: 0.5, 1 on_release: s.do_clear() - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/closebutton' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/closebutton' IconButton: size_hint: 0.5, 1 - icon: f'atlas://{KIVY_GUI_PATH}/theming/light/copy' + icon: f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/copy' on_release: s.do_paste() Button: id: qr