diff --git a/app/ui/views/yobble_home_view.py b/app/ui/views/yobble_home_view.py index de0c0d6..fbd0cb6 100644 --- a/app/ui/views/yobble_home_view.py +++ b/app/ui/views/yobble_home_view.py @@ -31,7 +31,7 @@ class YobbleHomeView(QWidget): self.bottom_bar = self.create_bottom_bar() main_layout.addWidget(self.bottom_bar) - self.update_styles() # Применяем стили при инициализации + self.update_styles() # Применяем стили при инициализации # Подключаемся к сигналу смены темы theme_manager.theme_changed.connect(self.update_styles) @@ -49,6 +49,7 @@ class YobbleHomeView(QWidget): self.burger_menu_button = QPushButton("☰") self.burger_menu_button.setObjectName("BurgerMenuButton") + self.burger_menu_button.setFocusPolicy(Qt.NoFocus) top_bar_layout.addWidget(self.burger_menu_button) self.title_label = QLabel("Чаты") @@ -81,7 +82,10 @@ class YobbleHomeView(QWidget): for btn in [btn_feed, btn_search, btn_chats, btn_profile]: btn.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) + btn.setFocusPolicy(Qt.NoFocus) + btn_create.setFocusPolicy(Qt.NoFocus) + self.update_tab_selection(2) return bottom_bar_widget @@ -89,6 +93,7 @@ class YobbleHomeView(QWidget): button = QPushButton() button.setObjectName("TabButton") button.setCursor(Qt.PointingHandCursor) + button.setFocusPolicy(Qt.NoFocus) layout = QVBoxLayout(button) layout.setContentsMargins(0, 5, 0, 5) @@ -114,6 +119,7 @@ class YobbleHomeView(QWidget): button.setObjectName("CreateButton") button.setFixedSize(56, 56) button.setCursor(Qt.PointingHandCursor) + button.setFocusPolicy(Qt.NoFocus) shadow = QGraphicsDropShadowEffect(self) shadow.setBlurRadius(18) @@ -137,7 +143,8 @@ class YobbleHomeView(QWidget): self.title_label.setText(titles[index]) def update_tab_selection(self, selected_index): - if not hasattr(self, 'bottom_bar'): return + if not hasattr(self, 'bottom_bar'): + return for button in self.bottom_bar.findChildren(QPushButton): is_tab_button = button.property("tab_index") is not None @@ -159,11 +166,27 @@ class YobbleHomeView(QWidget): active_color = "#0A84FF" top_bar_bg = "#2c2c2e" if is_dark else "#f5f5f5" top_bar_border = "#3c3c3c" if is_dark else "#e0e0e0" + hover_color = "#d0d0d0" if not is_dark else "#444444" return f""" YobbleHomeView {{ background-color: {bg_color}; }} + + /* Глобальные стили для кнопок */ + QPushButton {{ + background: transparent; + border: none; + outline: none; + }} + QPushButton:focus, + QPushButton:pressed, + QPushButton:checked {{ + background: transparent; + border: none; + outline: none; + }} + /* Верхняя панель */ #TopBar {{ background-color: {top_bar_bg}; @@ -174,6 +197,7 @@ class YobbleHomeView(QWidget): border: none; padding: 5px; color: {title_color}; + background: transparent; }} #TitleLabel {{ font-size: 18px; @@ -191,10 +215,15 @@ class YobbleHomeView(QWidget): /* Кнопки вкладок */ #TabButton {{ - background-color: transparent; + background: transparent; border: none; + outline: none; padding: 5px; }} + #TabButton:hover {{ + background-color: {hover_color}; + border-radius: 6px; + }} #TabButton #TabIcon {{ color: {text_color}; }} #TabButton #TabText {{ color: {text_color}; }}