Skip to content

Commit 79a0af9

Browse files
committed
Merge #c25befb
1 parent 6cd29b7 commit 79a0af9

File tree

4 files changed

+22
-28
lines changed

4 files changed

+22
-28
lines changed

src/kv/meile.kv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ WindowManager:
4545
orientation: 'vertical'
4646
md_bg_color: get_color_from_hex("#121212")
4747
MDFloatLayout:
48-
size_hint_y: .11
48+
size_hint_y: .1
4949

5050
Image:
5151
source: root.get_logo()

src/main/main.py

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
from ui.screens import MainWindow, PreLoadWindow, WalletRestore
33
from typedef.win import WindowNames
44
from conf.meile_config import MeileGuiConfig
5-
5+
from helpers.res import Resolution
66

77
from kivy.lang import Builder
88
from kivymd.app import MDApp
99
from kivymd.theming import ThemeManager
1010
from kivy.utils import get_color_from_hex
11-
from kivy.config import Config
12-
MeileConfig = MeileGuiConfig()
11+
from kivy.config import Config
1312
from screeninfo import get_monitors
1413

1514

@@ -20,6 +19,11 @@ class MyMainApp(MDApp):
2019
manager = None
2120
def __init__(self,**kwargs):
2221
super(MyMainApp,self).__init__(**kwargs)
22+
from kivy.core.window import Window
23+
24+
if Window.size[0] != dim[0] and Window.size[1] != dim[1]:
25+
Window.size = (dim[0], dim[1])
26+
2327

2428
def build(self):
2529

@@ -38,27 +42,16 @@ def build(self):
3842
#MeileConfig.read_configuration(MeileGuiConfig, MeileGuiConfig.CONFFILE)
3943
return self.manager
4044

41-
if len(get_monitors()) == 1:
42-
print("ONE MONITOR")
43-
primary_monitor = get_monitors()[0]
44-
else:
45-
for m in get_monitors():
46-
print(str(m))
47-
if m.is_primary:
48-
primary_monitor = m
49-
50-
dim = []
51-
dim.append(primary_monitor.width)
52-
dim.append(primary_monitor.height)
53-
l = int((dim[0] - 1280)/2)
54-
t = int((dim[1] - 800)/2)
45+
MeileConfig = MeileGuiConfig()
46+
47+
dim = Resolution().set_dimensions()
5548

56-
Config.set('kivy','window_icon',MeileConfig.resource_path("../imgs/icon.png"))
49+
Config.set('kivy','window_icon',MeileConfig.resource_path("imgs/icon.png"))
5750
Config.set('input', 'mouse', 'mouse,disable_multitouch')
58-
Config.set('graphics', 'width', '1280')
59-
Config.set('graphics', 'height', '800')
60-
Config.set('graphics', 'left', l)
61-
Config.set('graphics', 'top', t)
51+
Config.set('graphics', 'width', dim[0])
52+
Config.set('graphics', 'height', dim[1])
53+
Config.set('graphics', 'left', dim[2])
54+
Config.set('graphics', 'top', dim[3])
6255
Config.write()
6356

6457
app = MyMainApp()

src/typedef/konstants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ class MeileColors():
577577
DIALOG_BG_COLOR2 = "#181818"
578578
INDICATOR = "#00DD21"
579579
INACTIVE_DIALOG_BG_COLOR = "#50507c"
580+
MAP_BG_COLOR = "#232227"
580581
ROW_HOVER = "#39363c"
581582
FONT_FACE = "../fonts/mplus-2c-bold.ttf"
582583
FONT_FACE_ARIAL = "../fonts/arial-unicode-ms.ttf"

src/ui/screens.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -773,14 +773,14 @@ def build_node_data(self, ncountry):
773773
def build_meile_map(self):
774774

775775
if not self.MeileMapBuilt:
776-
self.MeileMap = MapView(zoom=2)
776+
self.MeileMap = MapView(zoom=2,
777+
background_color=get_color_from_hex(MeileColors.MAP_BG_COLOR))
777778
source = MapSource(url=MeileColors.ARCGIS_MAP,
778779
cache_key="meile-map-canvas-dark-grey-base-2",
779780
tile_size=256,
780781
image_ext="png",
781782
attribution="@ Meile",
782-
size_hint=(.7,1),
783-
min_zoom=2)
783+
min_zoom=1)
784784
#self.MeileMap.map_source = "osm"
785785
self.MeileMap.map_source = source
786786

@@ -817,7 +817,7 @@ def build_meile_map(self):
817817
self.MeileMapBuilt = True
818818

819819
def check_boundaries(self, instance, value):
820-
if self.MeileMap.zoom == 2:
820+
if self.MeileMap.zoom == 1:
821821
self.recenter_map()
822822

823823
def add_country_rv_data(self, NodeCountries):
@@ -1271,7 +1271,7 @@ def Refresh(self):
12711271

12721272
def recenter_map(self):
12731273
self.MeileMap.zoom = 2
1274-
self.MeileMap.center_on(0.0, 0.0)
1274+
self.MeileMap.center_on(0, 0)
12751275

12761276
def get_continent_coordinates(self, c):
12771277
loc = self.MeileLand.ContinentLatLong[c]

0 commit comments

Comments
 (0)