comparison cagou/core/common_widgets.py @ 491:203755bbe0fe

massive refactoring from camelCase -> snake_case. See backend commit log for more details
author Goffi <goffi@goffi.org>
date Sat, 08 Apr 2023 13:44:32 +0200
parents 3c9ba4a694ef
children
comparison
equal deleted inserted replaced
490:962d17c4078c 491:203755bbe0fe
107 107
108 @property 108 @property
109 def profile(self): 109 def profile(self):
110 return self.main_wid.profile 110 return self.main_wid.profile
111 111
112 def getSymbol(self): 112 def get_symbol(self):
113 if self.identities.type == 'desktop': 113 if self.identities.type == 'desktop':
114 return 'desktop' 114 return 'desktop'
115 elif self.identities.type == 'phone': 115 elif self.identities.type == 'phone':
116 return 'mobile' 116 return 'mobile'
117 elif self.identities.type == 'web': 117 elif self.identities.type == 'web':
156 self.previous_slide = self.carousel.current_slide 156 self.previous_slide = self.carousel.current_slide
157 self.carousel.bind(current_slide=self.on_slide_change) 157 self.carousel.bind(current_slide=self.on_slide_change)
158 158
159 def on_parent(self, __, parent): 159 def on_parent(self, __, parent):
160 # we hide the head widget to have full screen 160 # we hide the head widget to have full screen
161 G.host.app.showHeadWidget(not bool(parent), animation=False) 161 G.host.app.show_head_widget(not bool(parent), animation=False)
162 162
163 def on_sources(self, __, sources): 163 def on_sources(self, __, sources):
164 if not sources or not self.carousel: 164 if not sources or not self.carousel:
165 return 165 return
166 self.carousel.clear_widgets() 166 self.carousel.clear_widgets()
176 176
177 self.previous_slide = slide 177 self.previous_slide = slide
178 178
179 def key_input(self, window, key, scancode, codepoint, modifier): 179 def key_input(self, window, key, scancode, codepoint, modifier):
180 if key == 27: 180 if key == 27:
181 G.host.closeUI() 181 G.host.close_ui()
182 return True 182 return True