/
bulstray
/
CSVcleaner
Обзор
Документация
Войти
/
bulstray
/
CSVcleaner
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
models/button_model/button.py
35 строк
976 B
Bulstray
update all
12 янв 2026, 13:00
12 янв 2026, 13:00
484ea76
Код
Авторство
О чём код?
from PyQt6.QtWidgets import QPushButton from construct_helper.get_new_settings import recalc_str_settings from construct_helper.recalc_resolution import resolution_calc, new_resolutions def button_model(text: str, resolution, hover_color, w, h, **kwargs) -> QPushButton: button: QPushButton = QPushButton() w, h = map(lambda x: resolution_calc(resolution.w, resolution.h, x), [w, h] ) button.setFixedSize(int(w), int(h)) button.setText(text) new_settings: str = new_resolutions(resolution.w, resolution.h, kwargs) new_str_settings: str = ('QPushButton{' + recalc_str_settings(new_settings) + '}') button.setStyleSheet( new_str_settings + 'QPushButton::hover {' + f'background-color:{hover_color}' + '}' ) return button