patch home
This commit is contained in:
parent
4102c73124
commit
de41b87e7b
@ -49,6 +49,7 @@ class YobbleHomeView(QWidget):
|
|||||||
|
|
||||||
self.burger_menu_button = QPushButton("☰")
|
self.burger_menu_button = QPushButton("☰")
|
||||||
self.burger_menu_button.setObjectName("BurgerMenuButton")
|
self.burger_menu_button.setObjectName("BurgerMenuButton")
|
||||||
|
self.burger_menu_button.setFocusPolicy(Qt.NoFocus)
|
||||||
top_bar_layout.addWidget(self.burger_menu_button)
|
top_bar_layout.addWidget(self.burger_menu_button)
|
||||||
|
|
||||||
self.title_label = QLabel("Чаты")
|
self.title_label = QLabel("Чаты")
|
||||||
@ -81,6 +82,9 @@ class YobbleHomeView(QWidget):
|
|||||||
|
|
||||||
for btn in [btn_feed, btn_search, btn_chats, btn_profile]:
|
for btn in [btn_feed, btn_search, btn_chats, btn_profile]:
|
||||||
btn.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
|
btn.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
|
||||||
|
btn.setFocusPolicy(Qt.NoFocus)
|
||||||
|
|
||||||
|
btn_create.setFocusPolicy(Qt.NoFocus)
|
||||||
|
|
||||||
self.update_tab_selection(2)
|
self.update_tab_selection(2)
|
||||||
return bottom_bar_widget
|
return bottom_bar_widget
|
||||||
@ -89,6 +93,7 @@ class YobbleHomeView(QWidget):
|
|||||||
button = QPushButton()
|
button = QPushButton()
|
||||||
button.setObjectName("TabButton")
|
button.setObjectName("TabButton")
|
||||||
button.setCursor(Qt.PointingHandCursor)
|
button.setCursor(Qt.PointingHandCursor)
|
||||||
|
button.setFocusPolicy(Qt.NoFocus)
|
||||||
|
|
||||||
layout = QVBoxLayout(button)
|
layout = QVBoxLayout(button)
|
||||||
layout.setContentsMargins(0, 5, 0, 5)
|
layout.setContentsMargins(0, 5, 0, 5)
|
||||||
@ -114,6 +119,7 @@ class YobbleHomeView(QWidget):
|
|||||||
button.setObjectName("CreateButton")
|
button.setObjectName("CreateButton")
|
||||||
button.setFixedSize(56, 56)
|
button.setFixedSize(56, 56)
|
||||||
button.setCursor(Qt.PointingHandCursor)
|
button.setCursor(Qt.PointingHandCursor)
|
||||||
|
button.setFocusPolicy(Qt.NoFocus)
|
||||||
|
|
||||||
shadow = QGraphicsDropShadowEffect(self)
|
shadow = QGraphicsDropShadowEffect(self)
|
||||||
shadow.setBlurRadius(18)
|
shadow.setBlurRadius(18)
|
||||||
@ -137,7 +143,8 @@ class YobbleHomeView(QWidget):
|
|||||||
self.title_label.setText(titles[index])
|
self.title_label.setText(titles[index])
|
||||||
|
|
||||||
def update_tab_selection(self, selected_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):
|
for button in self.bottom_bar.findChildren(QPushButton):
|
||||||
is_tab_button = button.property("tab_index") is not None
|
is_tab_button = button.property("tab_index") is not None
|
||||||
@ -159,11 +166,27 @@ class YobbleHomeView(QWidget):
|
|||||||
active_color = "#0A84FF"
|
active_color = "#0A84FF"
|
||||||
top_bar_bg = "#2c2c2e" if is_dark else "#f5f5f5"
|
top_bar_bg = "#2c2c2e" if is_dark else "#f5f5f5"
|
||||||
top_bar_border = "#3c3c3c" if is_dark else "#e0e0e0"
|
top_bar_border = "#3c3c3c" if is_dark else "#e0e0e0"
|
||||||
|
hover_color = "#d0d0d0" if not is_dark else "#444444"
|
||||||
|
|
||||||
return f"""
|
return f"""
|
||||||
YobbleHomeView {{
|
YobbleHomeView {{
|
||||||
background-color: {bg_color};
|
background-color: {bg_color};
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
/* Глобальные стили для кнопок */
|
||||||
|
QPushButton {{
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
}}
|
||||||
|
QPushButton:focus,
|
||||||
|
QPushButton:pressed,
|
||||||
|
QPushButton:checked {{
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
}}
|
||||||
|
|
||||||
/* Верхняя панель */
|
/* Верхняя панель */
|
||||||
#TopBar {{
|
#TopBar {{
|
||||||
background-color: {top_bar_bg};
|
background-color: {top_bar_bg};
|
||||||
@ -174,6 +197,7 @@ class YobbleHomeView(QWidget):
|
|||||||
border: none;
|
border: none;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
color: {title_color};
|
color: {title_color};
|
||||||
|
background: transparent;
|
||||||
}}
|
}}
|
||||||
#TitleLabel {{
|
#TitleLabel {{
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@ -191,10 +215,15 @@ class YobbleHomeView(QWidget):
|
|||||||
|
|
||||||
/* Кнопки вкладок */
|
/* Кнопки вкладок */
|
||||||
#TabButton {{
|
#TabButton {{
|
||||||
background-color: transparent;
|
background: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
|
outline: none;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}}
|
}}
|
||||||
|
#TabButton:hover {{
|
||||||
|
background-color: {hover_color};
|
||||||
|
border-radius: 6px;
|
||||||
|
}}
|
||||||
#TabButton #TabIcon {{ color: {text_color}; }}
|
#TabButton #TabIcon {{ color: {text_color}; }}
|
||||||
#TabButton #TabText {{ color: {text_color}; }}
|
#TabButton #TabText {{ color: {text_color}; }}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user