Добавлен файл темы. Исправлен счёт веса реагентов
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"""
|
||||
Единый графический интерфейс для калькулятора сред и DoE
|
||||
"""
|
||||
|
||||
from theme import Colors, Fonts, Spacing, ButtonStyles, get_full_stylesheet, apply_theme
|
||||
import sys
|
||||
from typing import List, Dict, Optional
|
||||
|
||||
@@ -49,6 +49,7 @@ class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setWindowTitle("Биохимический помощник")
|
||||
self.setStyleSheet(get_full_stylesheet())
|
||||
self.setGeometry(100, 100, 1300, 800)
|
||||
self.setStyleSheet(self._get_stylesheet())
|
||||
|
||||
@@ -60,22 +61,7 @@ class MainWindow(QMainWindow):
|
||||
self._add_file_toolbar()
|
||||
|
||||
def _get_stylesheet(self):
|
||||
return """
|
||||
QMainWindow { background-color: #f0f0f0; }
|
||||
QGroupBox { font-weight: bold; border: 2px solid #ccc; border-radius: 8px; margin-top: 12px; padding-top: 12px; }
|
||||
QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 5px; color: #2c3e50; }
|
||||
QPushButton { background-color: #3498db; color: white; border: none; padding: 8px 16px; border-radius: 5px; font-weight: bold; }
|
||||
QPushButton:hover { background-color: #2980b9; }
|
||||
QPushButton#success { background-color: #27ae60; }
|
||||
QPushButton#success:hover { background-color: #219a52; }
|
||||
QPushButton#danger { background-color: #e74c3c; }
|
||||
QPushButton#danger:hover { background-color: #c0392b; }
|
||||
QTableWidget { gridline-color: #ddd; background-color: white; alternate-background-color: #f9f9f9; }
|
||||
QHeaderView::section { background-color: #34495e; color: white; padding: 6px; font-weight: bold; }
|
||||
QTabWidget::pane { border: 1px solid #ccc; border-radius: 5px; }
|
||||
QTabBar::tab { background-color: #ecf0f1; padding: 8px 16px; margin-right: 2px; }
|
||||
QTabBar::tab:selected { background-color: #3498db; color: white; }
|
||||
"""
|
||||
return get_full_stylesheet()
|
||||
|
||||
def _add_file_toolbar(self):
|
||||
"""Добавляет панель инструментов с кнопками сохранения/загрузки"""
|
||||
@@ -210,6 +196,11 @@ class MainWindow(QMainWindow):
|
||||
self.reagents_table.setItem(row, 1, QTableWidgetItem("0"))
|
||||
|
||||
unit_combo = QComboBox()
|
||||
unit_combo.setStyleSheet("""
|
||||
QComboBox {
|
||||
padding: 1px;
|
||||
}
|
||||
""")
|
||||
unit_combo.addItems(["мг", "г", "кг", "мкг", "нг", "мл", "мкл", "л", "нл"])
|
||||
unit_combo.setCurrentText("мл")
|
||||
self.reagents_table.setCellWidget(row, 2, unit_combo)
|
||||
|
||||
Reference in New Issue
Block a user