feat: move Exit button to title row, reduce spacing above numpad
- Exit button relocated from bottom-right overlay to right side of title row - Spacing between action buttons and update frame reduced 40px -> 10px - Rebuilt DatabaseApp.exe (30.9 MB)
This commit is contained in:
BIN
dist/DatabaseApp.exe
vendored
BIN
dist/DatabaseApp.exe
vendored
Binary file not shown.
37
main.py
37
main.py
@@ -39,9 +39,22 @@ class DatabaseApp(App):
|
|||||||
content_layout = BoxLayout(orientation='vertical', spacing=30, size_hint_y=None)
|
content_layout = BoxLayout(orientation='vertical', spacing=30, size_hint_y=None)
|
||||||
content_layout.bind(minimum_height=content_layout.setter('height'))
|
content_layout.bind(minimum_height=content_layout.setter('height'))
|
||||||
|
|
||||||
# Title
|
# Title row: title label + Exit button on the right
|
||||||
title = Label(text='Database Search & Update', font_size=28, bold=True, size_hint_y=None, height=50)
|
title_row = BoxLayout(orientation='horizontal', size_hint_y=None, height=50, spacing=15)
|
||||||
content_layout.add_widget(title)
|
title = Label(text='Database Search & Update', font_size=28, bold=True)
|
||||||
|
title_row.add_widget(title)
|
||||||
|
exit_btn = Button(
|
||||||
|
text='Exit',
|
||||||
|
font_size=18,
|
||||||
|
bold=True,
|
||||||
|
background_color=(0.85, 0.1, 0.1, 1),
|
||||||
|
color=(1, 1, 1, 1),
|
||||||
|
size_hint_x=None,
|
||||||
|
width=110
|
||||||
|
)
|
||||||
|
exit_btn.bind(on_press=lambda x: self.stop())
|
||||||
|
title_row.add_widget(exit_btn)
|
||||||
|
content_layout.add_widget(title_row)
|
||||||
|
|
||||||
# Search section
|
# Search section
|
||||||
search_layout = GridLayout(cols=2, size_hint_y=None, height=100, spacing=15, row_force_default=True, row_default_height=45)
|
search_layout = GridLayout(cols=2, size_hint_y=None, height=100, spacing=15, row_force_default=True, row_default_height=45)
|
||||||
@@ -105,8 +118,8 @@ class DatabaseApp(App):
|
|||||||
button_layout.add_widget(settings_btn)
|
button_layout.add_widget(settings_btn)
|
||||||
content_layout.add_widget(button_layout)
|
content_layout.add_widget(button_layout)
|
||||||
|
|
||||||
# Extra spacing between buttons and update frame
|
# Minimal spacing between buttons and update frame
|
||||||
content_layout.add_widget(Label(size_hint_y=None, height=40))
|
content_layout.add_widget(Label(size_hint_y=None, height=10))
|
||||||
|
|
||||||
# Update frame (initially disabled)
|
# Update frame (initially disabled)
|
||||||
self.update_frame = BoxLayout(orientation='vertical', padding=15, spacing=15, size_hint_y=None, height=200)
|
self.update_frame = BoxLayout(orientation='vertical', padding=15, spacing=15, size_hint_y=None, height=200)
|
||||||
@@ -173,20 +186,6 @@ class DatabaseApp(App):
|
|||||||
|
|
||||||
root.add_widget(main_layout)
|
root.add_widget(main_layout)
|
||||||
|
|
||||||
# Exit button — fixed to the bottom-right corner
|
|
||||||
exit_btn = Button(
|
|
||||||
text='Exit',
|
|
||||||
font_size=20,
|
|
||||||
bold=True,
|
|
||||||
background_color=(0.85, 0.1, 0.1, 1),
|
|
||||||
color=(1, 1, 1, 1),
|
|
||||||
size_hint=(None, None),
|
|
||||||
size=(120, 55),
|
|
||||||
pos_hint={'right': 1, 'y': 0}
|
|
||||||
)
|
|
||||||
exit_btn.bind(on_press=lambda x: self.stop())
|
|
||||||
root.add_widget(exit_btn)
|
|
||||||
|
|
||||||
# Init DB and load data in background so the UI appears immediately
|
# Init DB and load data in background so the UI appears immediately
|
||||||
def _init_db(dt):
|
def _init_db(dt):
|
||||||
def _do():
|
def _do():
|
||||||
|
|||||||
Reference in New Issue
Block a user