From 242d3df0bce94abfa01af873c6f50642c65c7d9a Mon Sep 17 00:00:00 2001 From: LupaDevStudio Date: Mon, 11 Dec 2023 12:33:28 +0100 Subject: [PATCH] add a cursor --- resources/images/cursor.png | Bin 0 -> 14400 bytes screens/custom_widgets/bottom_bar.kv | 21 +++++++++++++++++++++ screens/custom_widgets/bottom_bar.py | 20 ++++++++++++++++++++ screens/home.kv | 3 ++- 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 resources/images/cursor.png diff --git a/resources/images/cursor.png b/resources/images/cursor.png new file mode 100644 index 0000000000000000000000000000000000000000..1e1acd816a406f7b4ba6a8d7b6bda1d7616823cc GIT binary patch literal 14400 zcmeHtcRbeL-~U0%ii%WZq(RwxuZ&1Wwvc(*uFJUWaa}11ArT>~k|c!ejD}=|kdc|J z?Cg2{&Rc!feSd!U{rx=d-~IdR>roHyvtH-C#(9nB5vrweVLt@}1pr{bs*0jE0L1W< z7?ACSzm~i^HUJ_D(2Ptd9$d73FPj1Auq$%ze|lePYx%27SV$ ziB;$KNm1iYj_vi^+Gfpa=r6W%irRibqjT6)JNwk3J$FN!+%~ImOsgzc@A|u)HQ>&n zYvC;FupC$1-e%~souAzBul(x1-0rcu!{(+c*08M<-eQ$B^&n)NuyX0p)z#{Kz8dGp zxp3jWWtdB?I-=MOD>Q1o3!SZSmDRjrqtZ1m7#%Zx25#HaW3huhek@8!6vb`m-8}A zZ2LsH!n<^Wy_RdQT^W5h5K*!*%YOe#puot`t6-HGO%;n^W{vJH*PE)h&dwT&zZWx& zoqDMKm_GC9(YuvzL-i85E}Qf7Qk@Q+GkhcLT=67He%mdO6diHxHI*h|Z6+r3_)NjlC9sz3*AzK+6gvFA0H=2OKN(dCj#D`I2j?;@KoV~`yyGxz2BYSQ3)5l8$pwsE^k=>3Gq-ux9E%a2tR%mR0&KAXPz z-u!hzxOt@ga!MBeZEV~=83v7>DHRUKjJ7vVK1gViJ4P{>5Q)q0=eE!!vx(u{8@UmF zVRiES1eUCg{Bw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o^^LR?TC9?&sB?w}Ue`?@;bOBxy} zuu~$XadahB(rcDqc9;_6wpRsgGUz`yT(E^NqTS_gqYdh!{a76Yug-^g;^>dj#+;Kc zo^}v z>EqNF;IBmZr0cAw*ZIsv?3E>a*&T*ZNtshmfffpdg4N42vf%UbO2KNNp|dvp$aNUy z;3MzsSETxaHCLIxjI5-fU`)&S;&>)3sKyr8>)}Ihw7*Ph0xYy(C5B6G8ILM!30&AD Zh_qPRe literal 0 HcmV?d00001 diff --git a/screens/custom_widgets/bottom_bar.kv b/screens/custom_widgets/bottom_bar.kv index de8245b..89d646e 100644 --- a/screens/custom_widgets/bottom_bar.kv +++ b/screens/custom_widgets/bottom_bar.kv @@ -1,6 +1,15 @@ #:kivy 2.2.1 #:import PATH_IMAGES tools.path.PATH_IMAGES +# : +# color: (0,0,0,1) +# canvas: +# Color: +# rgba: self.color +# Rectangle: +# pos: self.pos +# size: self.size + : canvas.before: @@ -18,8 +27,17 @@ pos: (0,self.height) size: (self.width, self.separation_height) + Image: + id: selected_cursor + source: PATH_IMAGES + "cursor.png" + pos_hint: root.selected_rect_pos + fit_mode: "contain" + size_hint: root.selected_rect_size + color: root.selected_color + # Home button ImageButton: + id: home_button source: PATH_IMAGES + "home.png" size_hint: root.button_width, root.button_height pos_hint: {"center_x":0.125, "center_y":0.5} @@ -27,6 +45,7 @@ # Customization button ImageButton: + id: customization_button source: PATH_IMAGES + "customization.png" size_hint: root.button_width, root.button_height pos_hint: {"center_x":0.375, "center_y":0.5} @@ -34,6 +53,7 @@ # Profile button ImageButton: + id: profile_button source: PATH_IMAGES + "profile.png" size_hint: root.button_width, root.button_height pos_hint: {"center_x":0.625, "center_y":0.5} @@ -41,6 +61,7 @@ # Settings button ImageButton: + id: settings_button source: PATH_IMAGES + "settings.png" size_hint: root.button_width, root.button_height pos_hint: {"center_x":0.875, "center_y":0.5} diff --git a/screens/custom_widgets/bottom_bar.py b/screens/custom_widgets/bottom_bar.py index e36cc8a..0f9c9cb 100644 --- a/screens/custom_widgets/bottom_bar.py +++ b/screens/custom_widgets/bottom_bar.py @@ -6,7 +6,11 @@ ### Imports ### ############### +### Kivy imports ### from kivy.uix.relativelayout import RelativeLayout +from kivy.properties import ListProperty, StringProperty, ObjectProperty + +### Local imports ### from tools.kivy_tools import ImageButton ############# @@ -17,6 +21,22 @@ class BottomBar(RelativeLayout): background_color = (0, 0, 0, 0.5) separation_color = (1, 1, 1, 1) + selected_color = (1, 0, 0, 1) separation_height = 3 button_width = 0.15 button_height = 0.7 + selected = StringProperty() + selected_rect_pos = ObjectProperty((0, 0)) + selected_rect_size = ObjectProperty((0, 0)) + + def __init__(self, **kw): + super().__init__(**kw) + + def on_kv_post(self, base_widget): + if self.selected + "_button" in self.ids.keys(): + self.selected_rect_pos = self.ids[self.selected + + "_button"].pos_hint + self.selected_rect_size = \ + (self.ids[self.selected + "_button"].size_hint[0] * 1.2, + self.ids[self.selected + "_button"].size_hint[1] * 1.2) + return super().on_kv_post(base_widget) diff --git a/screens/home.kv b/screens/home.kv index 7db331a..e1f45c5 100644 --- a/screens/home.kv +++ b/screens/home.kv @@ -21,4 +21,5 @@ BottomBar: size_hint: (1, BOTTOM_BAR_HEIGHT) - pos_hint: {"bottom":0,"left":0} \ No newline at end of file + pos_hint: {"bottom":0,"left":0} + selected: "home" \ No newline at end of file