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:
2026-04-07 14:40:19 +03:00
parent df4a75ceaf
commit e0f510cebc
2 changed files with 18 additions and 19 deletions

37
main.py
View File

@@ -39,9 +39,22 @@ class DatabaseApp(App):
content_layout = BoxLayout(orientation='vertical', spacing=30, size_hint_y=None)
content_layout.bind(minimum_height=content_layout.setter('height'))
# Title
title = Label(text='Database Search & Update', font_size=28, bold=True, size_hint_y=None, height=50)
content_layout.add_widget(title)
# Title row: title label + Exit button on the right
title_row = BoxLayout(orientation='horizontal', size_hint_y=None, height=50, spacing=15)
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_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)
content_layout.add_widget(button_layout)
# Extra spacing between buttons and update frame
content_layout.add_widget(Label(size_hint_y=None, height=40))
# Minimal spacing between buttons and update frame
content_layout.add_widget(Label(size_hint_y=None, height=10))
# Update frame (initially disabled)
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)
# 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
def _init_db(dt):
def _do():