Merge pull request #706 from vishal332008/master

Fixing a few UI stuff.
This commit is contained in:
Eric Froemling 2024-06-23 00:42:32 -05:00 committed by GitHub
commit 6047d95e92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 31 additions and 9 deletions

View File

@ -109,6 +109,9 @@ class ConfigNumberEdit:
self._value = bui.app.config.resolve(configkey)
except ValueError:
self._value = bui.app.config.get(configkey, fallback_value)
self._value = (self._minval if self._minval > self._value else
self._maxval if self._maxval < self._value else
self._value)
self._as_percent = as_percent
self._f = f
@ -117,7 +120,7 @@ class ConfigNumberEdit:
position=position,
size=(100, 30),
text=displayname,
maxwidth=160 + xoffset,
#maxwidth=160 + xoffset,
color=(0.8, 0.8, 0.8, 1.0),
h_align='left',
v_align='center',
@ -125,7 +128,7 @@ class ConfigNumberEdit:
)
self.valuetext = bui.textwidget(
parent=parent,
position=(246 + xoffset, position[1]),
position=(position[0] + 146 + xoffset, position[1]),
size=(60, 28),
editable=False,
color=(0.3, 1.0, 0.3, 1.0),
@ -136,7 +139,7 @@ class ConfigNumberEdit:
)
self.minusbutton = bui.buttonwidget(
parent=parent,
position=(330 + xoffset, position[1]),
position=(position[0] + 230 + xoffset, position[1]),
size=(28, 28),
label='-',
autoselect=True,
@ -146,7 +149,7 @@ class ConfigNumberEdit:
)
self.plusbutton = bui.buttonwidget(
parent=parent,
position=(380 + xoffset, position[1]),
position=(position[0] + 280 + xoffset, position[1]),
size=(28, 28),
label='+',
autoselect=True,

View File

@ -578,8 +578,10 @@ class PartyWindow(bui.Window):
self._popup_party_member_is_host = is_host
def _send_chat_message(self) -> None:
bs.chatmessage(cast(str, bui.textwidget(query=self._text_field)))
bui.textwidget(edit=self._text_field, text='')
text = cast(str, bui.textwidget(query=self._text_field)).strip()
if text != '':
bs.chatmessage(text)
bui.textwidget(edit=self._text_field, text='')
def close(self) -> None:
"""Close the window."""

View File

@ -223,12 +223,15 @@ class ControlsSettingsWindow(bui.Window):
if show_keyboard:
self._keyboard_button = btn = bui.buttonwidget(
parent=self._root_widget,
position=((width - button_width) / 2 + 5, v),
position=((width - button_width) / 2 - 5, v),
size=(button_width, 43),
autoselect=True,
label=bui.Lstr(resource=self._r + '.configureKeyboardText'),
on_activate_call=self._config_keyboard,
)
bui.widget(
edit=self._keyboard_button, left_widget=self._keyboard_button
)
if bui.app.ui_v1.use_toolbars:
bui.widget(
edit=btn,
@ -253,6 +256,10 @@ class ControlsSettingsWindow(bui.Window):
on_activate_call=self._config_keyboard2,
)
v -= spacing
bui.widget(
edit=self._keyboard_2_button,
left_widget=self._keyboard_2_button
)
if show_space_2:
v -= space_height
if show_remote:
@ -264,6 +271,9 @@ class ControlsSettingsWindow(bui.Window):
label=bui.Lstr(resource=self._r + '.configureMobileText'),
on_activate_call=self._do_mobile_devices,
)
bui.widget(
edit=self._idevices_button, left_widget=self._idevices_button
)
if bui.app.ui_v1.use_toolbars:
bui.widget(
edit=btn,
@ -289,7 +299,7 @@ class ControlsSettingsWindow(bui.Window):
bui.getsound('gunCocking').play()
bui.set_low_level_config_value('enablexinput', not value)
bui.checkboxwidget(
xinput_checkbox = bui.checkboxwidget(
parent=self._root_widget,
position=(100, v + 3),
size=(120, 30),
@ -310,6 +320,11 @@ class ControlsSettingsWindow(bui.Window):
color=bui.app.ui_v1.infotextcolor,
maxwidth=width * 0.8,
)
bui.widget(
edit=xinput_checkbox,
left_widget=xinput_checkbox,
right_widget=xinput_checkbox
)
v -= spacing
if show_mac_controller_subsystem:

View File

@ -349,7 +349,9 @@ class PluginWindow(bui.Window):
text=bui.Lstr(value=classpath),
autoselect=True,
value=enabled,
maxwidth=self._scroll_width - 200,
maxwidth=self._scroll_width - (
200 if plugin is not None and plugin.has_settings_ui() else
80),
position=(10, item_y),
size=(self._scroll_width - 40, 50),
on_value_change_call=bui.Call(