From 5267d6068c93cec33255aaf009db1b847b18d2dc Mon Sep 17 00:00:00 2001 From: shekhar-cis Date: Wed, 7 Sep 2022 19:51:38 +0530 Subject: [PATCH] Add window size variable from kivy_state --- src/bitmessagekivy/main.kv | 6 +++--- src/bitmessagekivy/mpybit.py | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bitmessagekivy/main.kv b/src/bitmessagekivy/main.kv index a6703326..01b187b8 100644 --- a/src/bitmessagekivy/main.kv +++ b/src/bitmessagekivy/main.kv @@ -108,7 +108,7 @@ height:"35dp" NavigationItem: height: dp(48) - CustomSpinner: + IdentitySpinner: id: identity_dropdown pos_hint:{"x":0,"y":0} option_cls: Factory.get("MySpinnerOption") @@ -246,8 +246,8 @@ MDNavigationLayout: # id:sc16 # Allmails: # id:sc17 - ScanScreen: - id:is_scanscreen + # ScanScreen: + # id:is_scanscreen MDNavigationDrawer: id: nav_drawer diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index 29e637a4..5cce7e94 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -13,6 +13,7 @@ from functools import partial from kivy.clock import Clock from kivy.lang import Builder +from kivy.core.window import Window from kivy.uix.boxlayout import BoxLayout from kivymd.app import MDApp @@ -80,10 +81,13 @@ class IdentitySpinner(BaseIdentitySpinner): class NavigateApp(MDApp): """Navigation Layout of class""" + kivy_state = KivyStateVariables() title = "PyBitmessage" identity_list = get_identity_list() image_path = load_image_path() app_platform = platform + kivy_state.screen_density = Window.size + window_size = kivy_state.screen_density tr = Lang("en") # for changing in franch replace en with fr def __init__(self):