From 4aa7b9e0435848f558669598fb440acb7a660ce7 Mon Sep 17 00:00:00 2001 From: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com> Date: Sun, 19 Jul 2026 11:12:03 -0700 Subject: [PATCH] fix(ui): fix issues with tag and field widget appearances --- src/tagstudio/qt/mixed/tag_widget.py | 1 - src/tagstudio/qt/views/field_template_widget_view.py | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tagstudio/qt/mixed/tag_widget.py b/src/tagstudio/qt/mixed/tag_widget.py index 5b397ce0..2d702a4f 100644 --- a/src/tagstudio/qt/mixed/tag_widget.py +++ b/src/tagstudio/qt/mixed/tag_widget.py @@ -121,7 +121,6 @@ class TagWidget(QWidget): # if on_click_callback: self.setCursor(Qt.CursorShape.PointingHandCursor) self.base_layout = QVBoxLayout(self) - self.base_layout.setAlignment(Qt.AlignmentFlag.AlignLeft) self.base_layout.setObjectName("baseLayout") self.base_layout.setContentsMargins(0, 0, 0, 0) diff --git a/src/tagstudio/qt/views/field_template_widget_view.py b/src/tagstudio/qt/views/field_template_widget_view.py index 7ccd7d4a..fe916c11 100644 --- a/src/tagstudio/qt/views/field_template_widget_view.py +++ b/src/tagstudio/qt/views/field_template_widget_view.py @@ -12,8 +12,10 @@ from tagstudio.qt.views.stylesheets.stylesheets import ( get_tag_highlight_color, get_tag_text_color, list_button_style, + tag_remove_button_style, ) +# TODO: These colors and logic should be moved to and reworked in the stylesheets file. primary_color: QColor = QColor(get_tag_color(ColorType.PRIMARY, TagColorEnum.DEFAULT)) border_color: QColor = get_tag_border_color(primary_color) highlight_color: QColor = get_tag_highlight_color(primary_color) @@ -30,7 +32,6 @@ class FieldTemplateWidgetView(QWidget): self.__root_layout = QVBoxLayout(self) self.__root_layout.setObjectName("root_layout") - self.__root_layout.setAlignment(Qt.AlignmentFlag.AlignLeft) self.__root_layout.setContentsMargins(0, 0, 0, 0) # Background button @@ -58,6 +59,9 @@ class FieldTemplateWidgetView(QWidget): self._delete_button.setHidden(True) self._delete_button.setMinimumSize(22, 22) self._delete_button.setMaximumSize(22, 22) + self._delete_button.setStyleSheet( + tag_remove_button_style(primary_color, text_color, border_color, highlight_color) + ) self.__inner_layout.addWidget(self._delete_button) self.__inner_layout.setAlignment(Qt.AlignmentFlag.AlignLeft)