Skip to content

Commit

Permalink
Fix tooltip hint on NodeCarousel to remove burned hint on back. Chang…
Browse files Browse the repository at this point in the history
…e tooltip icon to 'server'. Add re-center tooltip icon on map @pixi_frog
  • Loading branch information
freQniK committed Oct 16, 2024
1 parent 5f19ae5 commit d6aa7c8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
15 changes: 12 additions & 3 deletions src/kv/meile.kv
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ WindowManager:
<TooltipMDFlatButton@MDFlatButton+MDTooltip>
<ToolTipMDIconButton@MDIconButton+MDTooltip>

<MapCenterButton@MDIconButton+MDTooltip>
pos_hint: {"x" : .015, "center_y": .975}
tooltip_text: "Center"
icon: "image-filter-center-focus"
theme_text_color: "Custom"
text_color: get_color_from_hex(MeileColors.MEILE)

<ProtectedLabel@MDLabel>
id: protected
font_size: sp(26)
Expand Down Expand Up @@ -1133,12 +1140,14 @@ WindowManager:
AnchorLayout:
anchor_x: "right"
TooltipMDIconButton:
icon: "spider-web"
#tooltip_text: "Map"
icon: "server-network"
tooltip_text: "Servers"
#size_hint_x: .01
theme_text_color: "Custom"
text_color: get_color_from_hex(MeileColors.MEILE)
on_press: root.switch_carousel()
on_press:
self.on_leave()
root.switch_carousel()
HSeparator:
HSeparator:
MDLabel:
Expand Down
3 changes: 1 addition & 2 deletions src/typedef/konstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ class ConfParams():
USER = environ['SUDO_USER'] if 'SUDO_USER' in environ else environ['USER']
PATH = environ['PATH']
KEYRINGDIR = path.join(path.expanduser('~' + USER), '.meile-gui')
BASEDIR = path.join(path.expanduser('~' + USER), '.sentinelcli')
BASEBINDIR = path.join(KEYRINGDIR, "bin")
WALLETINFO = path.join(KEYRINGDIR, "infos.txt")
SUBSCRIBEINFO = path.join(KEYRINGDIR, "subscribe.infos")
USUBSCRIBEINFO = path.join(KEYRINGDIR, "unsubscribe.infos")
CONNECTIONINFO = path.join(KEYRINGDIR, "connection.infos")
WIREGUARD_STATUS = path.join(BASEDIR, "status.json")
CHAINID = 'sentinelhub-2'
#CHAINID = 'testnet'
GASPRICE = "0.314159udvpn"
Expand Down
3 changes: 3 additions & 0 deletions src/ui/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class ProtectedLabel(MDLabel):
def get_font(self):
Config = MeileGuiConfig()
return Config.resource_path(MeileColors.QR_FONT_FACE)

class MapCenterButton(MDIconButton, MDTooltip):
pass

class ToolTipMDIconButton(MDIconButton, MDTooltip):
pass
Expand Down
10 changes: 9 additions & 1 deletion src/ui/screens.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from geography.continents import OurWorld
from ui.interfaces import Tab, LatencyContent, TooltipMDIconButton, ConnectionDialog, ProtectedLabel, IPAddressTextField, ConnectedNode, QuotaPct,BandwidthBar,BandwidthLabel
from ui.interfaces import Tab, LatencyContent, TooltipMDIconButton, ConnectionDialog, ProtectedLabel, IPAddressTextField, ConnectedNode, QuotaPct,BandwidthBar,BandwidthLabel, MapCenterButton
from typedef.win import WindowNames
from cli.sentinel import NodeTreeData
from typedef.konstants import NodeKeys, TextStrings, MeileColors, HTTParams, IBCTokens, ConfParams
Expand Down Expand Up @@ -782,6 +782,9 @@ def build_meile_map(self):
self.map_widget_1 = IPAddressTextField()
self.map_widget_2 = ConnectedNode()
self.map_widget_3 = ProtectedLabel()
self.recenter = MapCenterButton()

self.recenter.on_release = self.recenter_map

layout.add_widget(self.MeileMap)
layout.add_widget(self.map_widget_1)
Expand All @@ -790,6 +793,7 @@ def build_meile_map(self):
layout.add_widget(bw_label)
layout.add_widget(self.quota)
layout.add_widget(self.quota_pct)
layout.add_widget(self.recenter)

self.quota.value = 0
self.quota_pct.text = "0%"
Expand Down Expand Up @@ -1252,6 +1256,10 @@ def Refresh(self):
self.refresh_country_recycler()
self.remove_loading_widget(None)

def recenter_map(self):
self.MeileMap.zoom = 2
self.MeileMap.center_on(0.0, 0.0)

def get_continent_coordinates(self, c):
loc = self.MeileLand.ContinentLatLong[c]
self.MeileMap.zoom = 4
Expand Down

0 comments on commit d6aa7c8

Please sign in to comment.