Skip to content

Commit

Permalink
[kivy] change the sizing for macOS (ArchipelagoMW#1732)
Browse files Browse the repository at this point in the history
  • Loading branch information
kindasneaki authored Apr 19, 2023
1 parent 664bbd8 commit 0ca3c5e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions kvui.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from kivy.clock import Clock
from kivy.factory import Factory
from kivy.properties import BooleanProperty, ObjectProperty
from kivy.metrics import dp
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
Expand Down Expand Up @@ -343,18 +344,18 @@ def build(self) -> Layout:

self.grid = MainLayout()
self.grid.cols = 1
self.connect_layout = BoxLayout(orientation="horizontal", size_hint_y=None, height=30)
self.connect_layout = BoxLayout(orientation="horizontal", size_hint_y=None, height=dp(30))
# top part
server_label = ServerLabel()
self.connect_layout.add_widget(server_label)
self.server_connect_bar = ConnectBarTextInput(text=self.ctx.suggested_address or "archipelago.gg:", size_hint_y=None,
height=30, multiline=False, write_tab=False)
height=dp(30), multiline=False, write_tab=False)
def connect_bar_validate(sender):
if not self.ctx.server:
self.connect_button_action(sender)
self.server_connect_bar.bind(on_text_validate=connect_bar_validate)
self.connect_layout.add_widget(self.server_connect_bar)
self.server_connect_button = Button(text="Connect", size=(100, 30), size_hint_y=None, size_hint_x=None)
self.server_connect_button = Button(text="Connect", size=(dp(100), dp(30)), size_hint_y=None, size_hint_x=None)
self.server_connect_button.bind(on_press=self.connect_button_action)
self.connect_layout.add_widget(self.server_connect_button)
self.grid.add_widget(self.connect_layout)
Expand Down Expand Up @@ -387,11 +388,11 @@ def connect_bar_validate(sender):
self.tabs.tab_height = 0

# bottom part
bottom_layout = BoxLayout(orientation="horizontal", size_hint_y=None, height=30)
info_button = Button(height=30, text="Command:", size_hint_x=None)
bottom_layout = BoxLayout(orientation="horizontal", size_hint_y=None, height=dp(30))
info_button = Button(size=(dp(100), dp(30)), text="Command:", size_hint_x=None)
info_button.bind(on_release=self.command_button_action)
bottom_layout.add_widget(info_button)
self.textinput = TextInput(size_hint_y=None, height=30, multiline=False, write_tab=False)
self.textinput = TextInput(size_hint_y=None, height=dp(30), multiline=False, write_tab=False)
self.textinput.bind(on_text_validate=self.on_message)
self.textinput.text_validate_unfocus = False
bottom_layout.add_widget(self.textinput)
Expand Down

0 comments on commit 0ca3c5e

Please sign in to comment.