diff --git a/src/main-window.ui b/src/main-window.ui index 9bd7e57..328e34f 100644 --- a/src/main-window.ui +++ b/src/main-window.ui @@ -83,136 +83,69 @@ - - slide-left-right + + vertical + 200 - + - - full - - - vertical - 200 + + horizontal + 6 + 12 + 12 + 6 + 6 - - - - horizontal - 6 - 12 - 12 - 6 - 6 - - - - Projects - 0 - True - - - - - - - list-add-symbolic - Add Project - - - - - - - - sidebar-show-right-symbolic - Fold Sidebar - - - - - - - - - - - True - - - - - - - - - - - - Save Current Request - 12 - 12 - 12 - - - - + + + Projects + 0 + True + - + + + + + list-add-symbolic + Add Project + + + + - + - - slim - - - vertical - 60 - - - - - sidebar-show-left-symbolic - Unfold Sidebar - 6 - 6 - 6 - 6 - - - - - - - - - True - - - vertical - 6 - 6 - 6 - - - - + + True + + + - + + + + + + + + Save Current Request + 12 + 12 + 12 + + diff --git a/src/meson.build b/src/meson.build index d02f448..a0444dc 100644 --- a/src/meson.build +++ b/src/meson.build @@ -47,7 +47,6 @@ widgets_sources = [ 'widgets/history_item.py', 'widgets/project_item.py', 'widgets/request_item.py', - 'widgets/slim_project_item.py', ] install_data(widgets_sources, install_dir: moduledir / 'widgets') diff --git a/src/roster.gresource.xml b/src/roster.gresource.xml index e141c03..561d1ca 100644 --- a/src/roster.gresource.xml +++ b/src/roster.gresource.xml @@ -8,6 +8,5 @@ widgets/history-item.ui widgets/project-item.ui widgets/request-item.ui - widgets/slim-project-item.ui diff --git a/src/widgets/__init__.py b/src/widgets/__init__.py index c5be70a..afc6ef2 100644 --- a/src/widgets/__init__.py +++ b/src/widgets/__init__.py @@ -21,6 +21,5 @@ from .header_row import HeaderRow from .history_item import HistoryItem from .project_item import ProjectItem from .request_item import RequestItem -from .slim_project_item import SlimProjectItem -__all__ = ['HeaderRow', 'HistoryItem', 'ProjectItem', 'RequestItem', 'SlimProjectItem'] +__all__ = ['HeaderRow', 'HistoryItem', 'ProjectItem', 'RequestItem'] diff --git a/src/widgets/slim-project-item.ui b/src/widgets/slim-project-item.ui deleted file mode 100644 index 7a8964d..0000000 --- a/src/widgets/slim-project-item.ui +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - diff --git a/src/widgets/slim_project_item.py b/src/widgets/slim_project_item.py deleted file mode 100644 index f5b3e2e..0000000 --- a/src/widgets/slim_project_item.py +++ /dev/null @@ -1,44 +0,0 @@ -# slim_project_item.py -# -# Copyright 2025 Pavel Baksy -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# SPDX-License-Identifier: GPL-3.0-or-later - -from gi.repository import Gtk, GObject - - -@Gtk.Template(resource_path='/cz/vesp/roster/widgets/slim-project-item.ui') -class SlimProjectItem(Gtk.Button): - """Slim widget showing only project icon (for folded sidebar).""" - - __gtype_name__ = 'SlimProjectItem' - - project_icon = Gtk.Template.Child() - - __gsignals__ = { - 'project-clicked': (GObject.SIGNAL_RUN_FIRST, None, ()), - } - - def __init__(self, project): - super().__init__() - self.project = project - self.project_icon.set_from_icon_name(project.icon) - self.set_tooltip_text(project.name) - - @Gtk.Template.Callback() - def on_clicked(self, button): - """Handle click - unfold sidebar and show this project.""" - self.emit('project-clicked') diff --git a/src/window.py b/src/window.py index 75935f9..97d8a34 100644 --- a/src/window.py +++ b/src/window.py @@ -26,7 +26,6 @@ from .icon_picker_dialog import IconPickerDialog from .widgets.header_row import HeaderRow from .widgets.history_item import HistoryItem from .widgets.project_item import ProjectItem -from .widgets.slim_project_item import SlimProjectItem from datetime import datetime import threading @@ -45,13 +44,9 @@ class RosterWindow(Adw.ApplicationWindow): split_pane = Gtk.Template.Child() # Sidebar widgets - sidebar_stack = Gtk.Template.Child() projects_listbox = Gtk.Template.Child() - slim_projects_box = Gtk.Template.Child() add_project_button = Gtk.Template.Child() save_request_button = Gtk.Template.Child() - fold_sidebar_button = Gtk.Template.Child() - unfold_sidebar_button = Gtk.Template.Child() # Containers for tabs request_tabs_container = Gtk.Template.Child() @@ -458,13 +453,10 @@ class RosterWindow(Adw.ApplicationWindow): # Clear existing while child := self.projects_listbox.get_first_child(): self.projects_listbox.remove(child) - while child := self.slim_projects_box.get_first_child(): - self.slim_projects_box.remove(child) # Load and populate projects = self.project_manager.load_projects() for project in projects: - # Full project item item = ProjectItem(project) item.connect('edit-requested', self._on_project_edit, project) item.connect('delete-requested', self._on_project_delete, project) @@ -473,11 +465,6 @@ class RosterWindow(Adw.ApplicationWindow): item.connect('request-delete-requested', self._on_delete_request, project) self.projects_listbox.append(item) - # Slim project item - slim_item = SlimProjectItem(project) - slim_item.connect('project-clicked', self._on_slim_project_clicked) - self.slim_projects_box.append(slim_item) - @Gtk.Template.Callback() def on_add_project_clicked(self, button): """Show dialog to create project.""" @@ -709,19 +696,3 @@ class RosterWindow(Adw.ApplicationWindow): dialog.connect("response", on_response) dialog.present(self) - - # Sidebar fold/unfold methods - - @Gtk.Template.Callback() - def on_fold_sidebar_clicked(self, button): - """Fold the sidebar to slim view.""" - self.sidebar_stack.set_visible_child_name("slim") - - @Gtk.Template.Callback() - def on_unfold_sidebar_clicked(self, button): - """Unfold the sidebar to full view.""" - self.sidebar_stack.set_visible_child_name("full") - - def _on_slim_project_clicked(self, slim_item): - """Handle click on slim project item - unfold sidebar.""" - self.sidebar_stack.set_visible_child_name("full")