diff --git a/CatppuccinMocha/CatppuccinMocha.cfg b/CatppuccinMocha/CatppuccinMocha.cfg deleted file mode 100644 index 7144570..0000000 --- a/CatppuccinMocha/CatppuccinMocha.cfg +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CatppuccinMocha.qss - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/CatppuccinMocha/CatppuccinMocha.qss b/CatppuccinMocha/CatppuccinMocha.qss deleted file mode 100644 index 1c77ead..0000000 --- a/CatppuccinMocha/CatppuccinMocha.qss +++ /dev/null @@ -1,1308 +0,0 @@ - -/* ============================================================================= - Catppuccin Mocha Theme for FreeCAD - Bundled with ztools addon - https://catppuccin.com/ - ============================================================================= */ - -/* ============================================================================= - Global Defaults - ============================================================================= */ - -* { - color: #cdd6f4; - font-family: "Segoe UI", "Ubuntu", "Noto Sans", sans-serif; -} - -QWidget { - background-color: #1e1e2e; - color: #cdd6f4; - selection-background-color: #585b70; - selection-color: #cdd6f4; -} - -/* ============================================================================= - Main Window and MDI Area - ============================================================================= */ - -QMainWindow { - background-color: #181825; -} - -QMainWindow::separator { - background-color: #313244; - width: 4px; - height: 4px; -} - -QMainWindow::separator:hover { - background-color: #cba6f7; -} - -QMdiArea { - background-color: #11111b; -} - -QMdiSubWindow { - background-color: #1e1e2e; - border: 1px solid #45475a; -} - -QMdiSubWindow > QWidget { - background-color: #1e1e2e; -} - -/* ============================================================================= - Menu Bar - ============================================================================= */ - -QMenuBar { - background-color: #181825; - color: #cdd6f4; - border-bottom: 1px solid #313244; - padding: 2px; -} - -QMenuBar::item { - background-color: transparent; - padding: 4px 8px; - border-radius: 4px; -} - -QMenuBar::item:selected { - background-color: #313244; -} - -QMenuBar::item:pressed { - background-color: #45475a; -} - -/* ============================================================================= - Menus - ============================================================================= */ - -QMenu { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 6px; - padding: 4px; -} - -QMenu::item { - padding: 6px 24px 6px 8px; - border-radius: 4px; -} - -QMenu::item:selected { - background-color: #45475a; - color: #cdd6f4; -} - -QMenu::item:disabled { - color: #6c7086; -} - -QMenu::separator { - height: 1px; - background-color: #45475a; - margin: 4px 8px; -} - -QMenu::icon { - margin-left: 8px; -} - -QMenu::indicator { - width: 16px; - height: 16px; - margin-left: 4px; -} - -/* ============================================================================= - Toolbars - ============================================================================= */ - -QToolBar { - background-color: #181825; - border: none; - spacing: 2px; - padding: 2px; -} - -QToolBar::handle { - background-color: #45475a; - width: 8px; - margin: 2px; - border-radius: 2px; -} - -QToolBar::handle:horizontal { - width: 8px; -} - -QToolBar::handle:vertical { - height: 8px; -} - -QToolBar::separator { - background-color: #45475a; - width: 1px; - margin: 4px 2px; -} - -/* ============================================================================= - Tool Buttons (Toolbar icons) - ============================================================================= */ - -QToolButton { - background-color: transparent; - border: 1px solid transparent; - border-radius: 4px; - padding: 4px; - margin: 1px; -} - -QToolButton:hover { - background-color: #313244; - border: 1px solid #45475a; -} - -QToolButton:pressed { - background-color: #45475a; -} - -QToolButton:checked { - background-color: #45475a; - border: 1px solid #cba6f7; -} - -QToolButton:disabled { - color: #6c7086; -} - -QToolButton[popupMode="1"] { - padding-right: 16px; -} - -QToolButton::menu-button { - border: none; - width: 14px; -} - -QToolButton::menu-arrow { - width: 10px; - height: 10px; -} - -/* ============================================================================= - Push Buttons - ============================================================================= */ - -QPushButton { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 6px; - padding: 6px 16px; - min-height: 20px; -} - -QPushButton:hover { - background-color: #45475a; - border-color: #585b70; -} - -QPushButton:pressed { - background-color: #585b70; -} - -QPushButton:checked { - background-color: #cba6f7; - color: #11111b; - border-color: #cba6f7; -} - -QPushButton:disabled { - background-color: #313244; - color: #6c7086; - border-color: #313244; -} - -QPushButton:default { - border: 2px solid #cba6f7; -} - -/* ============================================================================= - Dock Widgets - ============================================================================= */ - -QDockWidget { - background-color: #1e1e2e; - color: #cdd6f4; - titlebar-close-icon: none; - titlebar-normal-icon: none; -} - -QDockWidget::title { - background-color: #181825; - color: #cdd6f4; - padding: 8px 6px; - border-bottom: 1px solid #313244; - min-height: 18px; -} - -QDockWidget::close-button, -QDockWidget::float-button { - background-color: transparent; - border: none; - padding: 2px; -} - -QDockWidget::close-button:hover, -QDockWidget::float-button:hover { - background-color: #313244; - border-radius: 4px; -} - -/* ============================================================================= - Tab Widgets - ============================================================================= */ - -QTabWidget::pane { - background-color: #1e1e2e; - border: 1px solid #45475a; - border-radius: 4px; - top: -1px; -} - -QTabBar { - background-color: transparent; -} - -QTabBar::tab { - background-color: #313244; - color: #bac2de; - border: 1px solid #45475a; - padding: 6px 12px; - margin-right: 2px; - border-top-left-radius: 6px; - border-top-right-radius: 6px; -} - -QTabBar::tab:selected { - background-color: #1e1e2e; - color: #cdd6f4; - border-bottom-color: #1e1e2e; -} - -QTabBar::tab:hover:!selected { - background-color: #45475a; - color: #cdd6f4; -} - -QTabBar::tab:disabled { - color: #6c7086; -} - -QTabBar::close-button { - margin-left: 4px; -} - -QTabBar::close-button:hover { - background-color: #f38ba8; - border-radius: 2px; -} - -/* ============================================================================= - Scroll Bars - ============================================================================= */ - -QScrollBar:horizontal { - background-color: #181825; - height: 12px; - margin: 0 12px 0 12px; - border-radius: 6px; -} - -QScrollBar:vertical { - background-color: #181825; - width: 12px; - margin: 12px 0 12px 0; - border-radius: 6px; -} - -QScrollBar::handle:horizontal { - background-color: #45475a; - min-width: 20px; - border-radius: 5px; - margin: 1px; -} - -QScrollBar::handle:vertical { - background-color: #45475a; - min-height: 20px; - border-radius: 5px; - margin: 1px; -} - -QScrollBar::handle:horizontal:hover, -QScrollBar::handle:vertical:hover { - background-color: #585b70; -} - -QScrollBar::add-line:horizontal, -QScrollBar::sub-line:horizontal, -QScrollBar::add-line:vertical, -QScrollBar::sub-line:vertical { - width: 12px; - height: 12px; - background-color: #313244; - border-radius: 6px; -} - -QScrollBar::add-line:horizontal:hover, -QScrollBar::sub-line:horizontal:hover, -QScrollBar::add-line:vertical:hover, -QScrollBar::sub-line:vertical:hover { - background-color: #45475a; -} - -QScrollBar::add-page:horizontal, -QScrollBar::sub-page:horizontal, -QScrollBar::add-page:vertical, -QScrollBar::sub-page:vertical { - background-color: transparent; -} - -/* ============================================================================= - Input Fields - ============================================================================= */ - -QLineEdit { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - padding: 4px 8px; - selection-background-color: #cba6f7; - selection-color: #11111b; -} - -QLineEdit:focus { - border-color: #cba6f7; -} - -QLineEdit:disabled { - background-color: #181825; - color: #6c7086; -} - -QLineEdit:read-only { - background-color: #181825; -} - -QTextEdit, QPlainTextEdit { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - selection-background-color: #cba6f7; - selection-color: #11111b; -} - -QTextEdit:focus, QPlainTextEdit:focus { - border-color: #cba6f7; -} - -/* ============================================================================= - Spin Boxes - ============================================================================= */ - -QSpinBox, QDoubleSpinBox { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - padding: 4px; - padding-right: 20px; -} - -QSpinBox:focus, QDoubleSpinBox:focus { - border-color: #cba6f7; -} - -QSpinBox:disabled, QDoubleSpinBox:disabled { - background-color: #181825; - color: #6c7086; -} - -QSpinBox::up-button, QDoubleSpinBox::up-button { - subcontrol-origin: border; - subcontrol-position: top right; - width: 16px; - border-left: 1px solid #45475a; - border-top-right-radius: 4px; - background-color: #45475a; -} - -QSpinBox::down-button, QDoubleSpinBox::down-button { - subcontrol-origin: border; - subcontrol-position: bottom right; - width: 16px; - border-left: 1px solid #45475a; - border-bottom-right-radius: 4px; - background-color: #45475a; -} - -QSpinBox::up-button:hover, QDoubleSpinBox::up-button:hover, -QSpinBox::down-button:hover, QDoubleSpinBox::down-button:hover { - background-color: #585b70; -} - -QSpinBox::up-button:pressed, QDoubleSpinBox::up-button:pressed, -QSpinBox::down-button:pressed, QDoubleSpinBox::down-button:pressed { - background-color: #cba6f7; -} - -QSpinBox::up-arrow, QDoubleSpinBox::up-arrow { - width: 0px; - height: 0px; - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-bottom: 6px solid #cdd6f4; -} - -QSpinBox::up-arrow:hover, QDoubleSpinBox::up-arrow:hover { - border-bottom-color: #f5e0dc; -} - -QSpinBox::up-arrow:disabled, QDoubleSpinBox::up-arrow:disabled { - border-bottom-color: #6c7086; -} - -QSpinBox::down-arrow, QDoubleSpinBox::down-arrow { - width: 0px; - height: 0px; - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 6px solid #cdd6f4; -} - -QSpinBox::down-arrow:hover, QDoubleSpinBox::down-arrow:hover { - border-top-color: #f5e0dc; -} - -QSpinBox::down-arrow:disabled, QDoubleSpinBox::down-arrow:disabled { - border-top-color: #6c7086; -} - -/* ============================================================================= - Combo Boxes - ============================================================================= */ - -QComboBox { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - padding: 4px 8px; - padding-right: 24px; - min-height: 20px; -} - -QComboBox:hover { - border-color: #585b70; -} - -QComboBox:focus { - border-color: #cba6f7; -} - -QComboBox:disabled { - background-color: #181825; - color: #6c7086; -} - -QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border-left: 1px solid #45475a; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - background-color: #45475a; -} - -QComboBox::drop-down:hover { - background-color: #585b70; -} - -QComboBox::down-arrow { - width: 0px; - height: 0px; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - border-top: 6px solid #cdd6f4; -} - -QComboBox::down-arrow:disabled { - border-top-color: #6c7086; -} - -QComboBox QAbstractItemView { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - selection-background-color: #45475a; - selection-color: #cdd6f4; - outline: none; -} - -QComboBox QAbstractItemView::item { - padding: 4px 8px; - min-height: 24px; -} - -QComboBox QAbstractItemView::item:hover { - background-color: #45475a; -} - -QComboBox QAbstractItemView::item:selected { - background-color: #585b70; -} - -/* ============================================================================= - Check Boxes - ============================================================================= */ - -QCheckBox { - spacing: 8px; - color: #cdd6f4; -} - -QCheckBox:disabled { - color: #6c7086; -} - -QCheckBox::indicator { - width: 18px; - height: 18px; - border: 2px solid #585b70; - border-radius: 4px; - background-color: #313244; -} - -QCheckBox::indicator:hover { - border-color: #cba6f7; -} - -QCheckBox::indicator:checked { - background-color: #cba6f7; - border-color: #cba6f7; -} - -QCheckBox::indicator:checked:disabled { - background-color: #6c7086; - border-color: #6c7086; -} - -QCheckBox::indicator:disabled { - background-color: #181825; - border-color: #45475a; -} - -/* ============================================================================= - Radio Buttons - ============================================================================= */ - -QRadioButton { - spacing: 8px; - color: #cdd6f4; -} - -QRadioButton:disabled { - color: #6c7086; -} - -QRadioButton::indicator { - width: 18px; - height: 18px; - border: 2px solid #585b70; - border-radius: 9px; - background-color: #313244; -} - -QRadioButton::indicator:hover { - border-color: #cba6f7; -} - -QRadioButton::indicator:checked { - background-color: #cba6f7; - border-color: #cba6f7; -} - -QRadioButton::indicator:checked:disabled { - background-color: #6c7086; - border-color: #6c7086; -} - -QRadioButton::indicator:disabled { - background-color: #181825; - border-color: #45475a; -} - -/* ============================================================================= - Sliders - ============================================================================= */ - -QSlider::groove:horizontal { - height: 6px; - background-color: #45475a; - border-radius: 3px; -} - -QSlider::groove:vertical { - width: 6px; - background-color: #45475a; - border-radius: 3px; -} - -QSlider::handle:horizontal { - width: 16px; - height: 16px; - margin: -5px 0; - background-color: #cba6f7; - border-radius: 8px; -} - -QSlider::handle:vertical { - width: 16px; - height: 16px; - margin: 0 -5px; - background-color: #cba6f7; - border-radius: 8px; -} - -QSlider::handle:horizontal:hover, -QSlider::handle:vertical:hover { - background-color: #b4befe; -} - -QSlider::handle:horizontal:pressed, -QSlider::handle:vertical:pressed { - background-color: #f5c2e7; -} - -QSlider::sub-page:horizontal { - background-color: #cba6f7; - border-radius: 3px; -} - -QSlider::add-page:vertical { - background-color: #cba6f7; - border-radius: 3px; -} - -/* ============================================================================= - Progress Bars - ============================================================================= */ - -QProgressBar { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - text-align: center; - height: 20px; -} - -QProgressBar::chunk { - background-color: #cba6f7; - border-radius: 3px; -} - -/* ============================================================================= - Group Boxes - ============================================================================= */ - -QGroupBox { - background-color: #1e1e2e; - border: 1px solid #45475a; - border-radius: 6px; - margin-top: 12px; - padding-top: 8px; -} - -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top left; - left: 12px; - padding: 0 4px; - color: #bac2de; - background-color: #1e1e2e; -} - -/* ============================================================================= - Tree View - ============================================================================= */ - -QTreeView { - background-color: #1e1e2e; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - outline: none; - show-decoration-selected: 1; -} - -QTreeView::item { - padding: 4px; - border-radius: 2px; -} - -QTreeView::item:hover { - background-color: #313244; -} - -QTreeView::item:selected { - background-color: #45475a; - color: #cdd6f4; -} - -QTreeView::item:selected:active { - background-color: #585b70; -} - -QTreeView::branch { - background-color: transparent; -} - -QTreeView::branch:hover { - background-color: #313244; -} - -QTreeView::branch:selected { - background-color: #45475a; -} - -/* Spanning tree branch lines */ -QTreeView::branch:has-siblings:!adjoins-item { - image: url(qss:images_dark-light/branch_vline_dark.svg); -} - -QTreeView::branch:has-siblings:adjoins-item { - image: url(qss:images_dark-light/branch_more_dark.svg); -} - -QTreeView::branch:!has-children:!has-siblings:adjoins-item { - image: url(qss:images_dark-light/branch_end_dark.svg); -} - -/* Closed branches with children */ -QTreeView::branch:closed:has-children:has-siblings { - image: url(qss:images_dark-light/branch_more_closed_dark.svg); -} - -QTreeView::branch:closed:has-children:!has-siblings { - image: url(qss:images_dark-light/branch_end_closed_dark.svg); -} - -/* Open branches with children */ -QTreeView::branch:open:has-children:has-siblings { - image: url(qss:images_dark-light/branch_more_open_dark.svg); -} - -QTreeView::branch:open:has-children:!has-siblings { - image: url(qss:images_dark-light/branch_end_open_dark.svg); -} - -/* ============================================================================= - List View - ============================================================================= */ - -QListView { - background-color: #1e1e2e; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - outline: none; -} - -QListView::item { - padding: 4px; - border-radius: 2px; -} - -QListView::item:hover { - background-color: #313244; -} - -QListView::item:selected { - background-color: #45475a; - color: #cdd6f4; -} - -/* ============================================================================= - Table View - ============================================================================= */ - -QTableView { - background-color: #1e1e2e; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - gridline-color: #313244; - outline: none; -} - -QTableView::item { - padding: 4px; -} - -QTableView::item:hover { - background-color: #313244; -} - -QTableView::item:selected { - background-color: #45475a; - color: #cdd6f4; -} - -QTableView QTableCornerButton::section { - background-color: #313244; - border: 1px solid #45475a; -} - -/* ============================================================================= - Header Views (for Tables/Trees) - ============================================================================= */ - -QHeaderView { - background-color: #313244; - border: none; -} - -QHeaderView::section { - background-color: #313244; - color: #bac2de; - border: none; - border-right: 1px solid #45475a; - border-bottom: 1px solid #45475a; - padding: 6px 8px; - min-height: 20px; -} - -QHeaderView::section:hover { - background-color: #45475a; - color: #cdd6f4; -} - -QHeaderView::section:checked { - background-color: #45475a; -} - -QHeaderView::down-arrow { - width: 0px; - height: 0px; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - border-top: 6px solid #cdd6f4; -} - -QHeaderView::up-arrow { - width: 0px; - height: 0px; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - border-bottom: 6px solid #cdd6f4; -} - -/* ============================================================================= - Splitters - ============================================================================= */ - -QSplitter::handle { - background-color: #313244; -} - -QSplitter::handle:horizontal { - width: 4px; -} - -QSplitter::handle:vertical { - height: 4px; -} - -QSplitter::handle:hover { - background-color: #cba6f7; -} - -/* ============================================================================= - Status Bar - ============================================================================= */ - -QStatusBar { - background-color: #181825; - color: #bac2de; - border-top: 1px solid #313244; -} - -QStatusBar::item { - border: none; -} - -QStatusBar QLabel { - padding: 2px 8px; -} - -/* ============================================================================= - Tooltips - ============================================================================= */ - -QToolTip { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - padding: 4px 8px; -} - -/* ============================================================================= - Labels - ============================================================================= */ - -QLabel { - color: #cdd6f4; - background-color: transparent; -} - -QLabel:disabled { - color: #6c7086; -} - -/* ============================================================================= - Frames - ============================================================================= */ - -QFrame { - border: none; -} - -QFrame[frameShape="4"] { - /* HLine */ - background-color: #45475a; - max-height: 1px; -} - -QFrame[frameShape="5"] { - /* VLine */ - background-color: #45475a; - max-width: 1px; -} - -/* ============================================================================= - Tool Box (Collapsible sections) - ============================================================================= */ - -QToolBox { - background-color: #1e1e2e; - border: 1px solid #45475a; - border-radius: 4px; -} - -QToolBox::tab { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - padding: 8px; -} - -QToolBox::tab:selected { - background-color: #45475a; - border-color: #cba6f7; -} - -QToolBox::tab:hover { - background-color: #45475a; -} - -/* ============================================================================= - Dialog Buttons - ============================================================================= */ - -QDialogButtonBox { - button-layout: 0; -} - -/* ============================================================================= - Date/Time Edits - ============================================================================= */ - -QDateEdit, QTimeEdit, QDateTimeEdit { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - padding: 4px; -} - -QDateEdit:focus, QTimeEdit:focus, QDateTimeEdit:focus { - border-color: #cba6f7; -} - -QDateEdit::drop-down, QTimeEdit::drop-down, QDateTimeEdit::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border-left: 1px solid #45475a; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - background-color: #45475a; -} - -QCalendarWidget { - background-color: #1e1e2e; -} - -QCalendarWidget QToolButton { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - margin: 2px; -} - -QCalendarWidget QToolButton:hover { - background-color: #45475a; -} - -QCalendarWidget QMenu { - background-color: #313244; -} - -QCalendarWidget QSpinBox { - background-color: #313244; -} - -QCalendarWidget QAbstractItemView { - background-color: #1e1e2e; - selection-background-color: #cba6f7; - selection-color: #11111b; -} - -/* ============================================================================= - Wizard - ============================================================================= */ - -QWizard { - background-color: #1e1e2e; -} - -QWizard QLabel { - color: #cdd6f4; -} - -/* ============================================================================= - FreeCAD Specific Widgets - ============================================================================= */ - -/* Property Editor */ -Gui--PropertyEditor--PropertyEditor { - background-color: #1e1e2e; - color: #cdd6f4; - border: 1px solid #45475a; - qproperty-groupBackground: #313244; - qproperty-groupTextColor: #bac2de; - qproperty-itemBackground: #1e1e2e; -} - -Gui--PropertyEditor--PropertyEditor QLineEdit { - background-color: #313244; - border: 1px solid #45475a; -} - -Gui--PropertyEditor--PropertyEditor QComboBox { - background-color: #313244; -} - -/* Color Button */ -Gui--ColorButton { - background-color: #313244; - border: 1px solid #45475a; - border-radius: 4px; - padding: 2px; -} - -Gui--ColorButton:hover { - border-color: #cba6f7; -} - -/* Workbench Selector */ -Gui--WorkbenchComboBox { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; - padding: 4px 8px; -} - -Gui--WorkbenchComboBox:hover { - border-color: #585b70; -} - -Gui--WorkbenchComboBox::drop-down { - background-color: #45475a; - border-left: 1px solid #45475a; - border-radius: 0 4px 4px 0; -} - -/* Task Panel */ -QSint--ActionGroup { - background-color: #313244; - border: 1px solid #45475a; - border-radius: 6px; -} - -QSint--ActionGroup QToolButton { - background-color: #313244; - color: #cdd6f4; - border: none; - border-radius: 4px; - padding: 8px 6px; - min-height: 18px; -} - -QSint--ActionGroup QToolButton:hover { - background-color: #45475a; -} - -QSint--ActionGroup QFrame { - background-color: #1e1e2e; - border: none; - border-radius: 4px; -} - -/* Input Field */ -Gui--InputField { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; - border-radius: 4px; -} - -Gui--InputField:focus { - border-color: #cba6f7; -} - -/* Expression Completer */ -Gui--ExpressionCompleter { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #45475a; -} - -/* Spreadsheet */ -SpreadsheetGui--SheetTableView { - background-color: #1e1e2e; - color: #cdd6f4; - gridline-color: #45475a; - selection-background-color: #45475a; - selection-color: #cdd6f4; -} - -SpreadsheetGui--SheetTableView QHeaderView::section { - background-color: #313244; - color: #bac2de; - border: 1px solid #45475a; - padding: 4px; -} - -/* Spreadsheet cell editor - reduce padding for better text visibility */ -SpreadsheetGui--SheetTableView QLineEdit { - background-color: #313244; - color: #cdd6f4; - border: 1px solid #cba6f7; - border-radius: 0px; - padding: 1px 2px; - margin: 0px; -} - -/* Python Console */ -Gui--PythonConsole { - background-color: #11111b; - color: #cdd6f4; - font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace; - selection-background-color: #45475a; -} - -/* Python Editor */ -Gui--PythonEditor { - background-color: #11111b; - color: #cdd6f4; - font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace; - selection-background-color: #cba6f7; - selection-color: #11111b; -} - -/* Report View */ -Gui--DockWnd--ReportOutput { - background-color: #11111b; - color: #cdd6f4; - font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace; -} - -/* DAG View */ -Gui--DAG--Model { - background-color: #1e1e2e; -} - -/* ============================================================================= - Sketcher Specific Styles - ============================================================================= */ - -/* Sketcher constraint colors are handled via preferences, not QSS */ - -/* ============================================================================= - Syntax Highlighting Colors (Python Editor) - Note: These are typically set via FreeCAD preferences, but we define them here - for reference and any widgets that support them. - ============================================================================= */ - -/* - Python Editor Syntax Colors (Catppuccin Mocha): - - Comment: #7f849c - - Number: #fab387 - - String: #a6e3a1 - - Keyword: #cba6f7 - - Class/Def name: #89b4fa - - Operator: #89dceb - - Output: #cdd6f4 - - Error: #f38ba8 -*/ - -/* ============================================================================= - Custom Color Accents by Context - ============================================================================= */ - -/* Success states */ -*[state="success"] { - color: #a6e3a1; -} - -/* Warning states */ -*[state="warning"] { - color: #f9e2af; -} - -/* Error states */ -*[state="error"] { - color: #f38ba8; -} - -/* Info states */ -*[state="info"] { - color: #89b4fa; -} diff --git a/package.xml b/package.xml index 725bbe0..ac2658b 100644 --- a/package.xml +++ b/package.xml @@ -3,7 +3,7 @@ ZTools - Extended PartDesign workbench with velocity-focused tools, advanced datum creation, and Catppuccin Mocha theme. + Extended PartDesign workbench with velocity-focused tools and advanced datum creation. 0.1.0 @@ -17,16 +17,6 @@ ZToolsWorkbench ./ztools - - CatppuccinMocha - Catppuccin Mocha dark theme - soothing pastel colors for the high-spirited - ./CatppuccinMocha - color - dark - catppuccin - mocha - theme - diff --git a/ztools/InitGui.py b/ztools/InitGui.py index 78e114e..724a40a 100644 --- a/ztools/InitGui.py +++ b/ztools/InitGui.py @@ -305,14 +305,6 @@ class ZToolsWorkbench(Gui.Workbench): def Activated(self): """Called when workbench is activated.""" - # Apply Catppuccin Mocha colors to Spreadsheet preferences - try: - from ztools.resources.theme import apply_spreadsheet_colors - - apply_spreadsheet_colors() - except Exception as e: - App.Console.PrintWarning(f"Could not apply spreadsheet colors: {e}\n") - App.Console.PrintMessage("ztools workbench activated\n") def Deactivated(self): diff --git a/ztools/ztools/resources/__init__.py b/ztools/ztools/resources/__init__.py index eaa5d09..01d944b 100644 --- a/ztools/ztools/resources/__init__.py +++ b/ztools/ztools/resources/__init__.py @@ -1,10 +1,8 @@ # ztools/resources - Icons and assets from .icons import MOCHA, get_icon, save_icons_to_disk -from .theme import get_stylesheet __all__ = [ "get_icon", "save_icons_to_disk", "MOCHA", - "get_stylesheet", ] diff --git a/ztools/ztools/resources/theme.py b/ztools/ztools/resources/theme.py deleted file mode 100644 index f977874..0000000 --- a/ztools/ztools/resources/theme.py +++ /dev/null @@ -1,1395 +0,0 @@ -# ztools/resources/theme.py -# Catppuccin Mocha theme for FreeCAD -# -# This module generates a comprehensive Qt stylesheet (QSS) that applies the -# Catppuccin Mocha color palette across the entire FreeCAD interface. -# -# The theme is automatically installed to FreeCAD's Gui/Stylesheets directory -# by Init.py at startup, making it available in: -# Edit > Preferences > General > Stylesheet - -from kindred_sdk.theme import get_theme_tokens - -MOCHA = get_theme_tokens() - -# Convenience aliases for commonly used colors -_base = MOCHA["base"] -_mantle = MOCHA["mantle"] -_crust = MOCHA["crust"] -_surface0 = MOCHA["surface0"] -_surface1 = MOCHA["surface1"] -_surface2 = MOCHA["surface2"] -_overlay0 = MOCHA["overlay0"] -_overlay1 = MOCHA["overlay1"] -_overlay2 = MOCHA["overlay2"] -_subtext0 = MOCHA["subtext0"] -_subtext1 = MOCHA["subtext1"] -_text = MOCHA["text"] -_lavender = MOCHA["lavender"] -_blue = MOCHA["blue"] -_sapphire = MOCHA["sapphire"] -_sky = MOCHA["sky"] -_teal = MOCHA["teal"] -_green = MOCHA["green"] -_yellow = MOCHA["yellow"] -_peach = MOCHA["peach"] -_maroon = MOCHA["maroon"] -_red = MOCHA["red"] -_mauve = MOCHA["mauve"] -_pink = MOCHA["pink"] -_flamingo = MOCHA["flamingo"] -_rosewater = MOCHA["rosewater"] - - -def generate_stylesheet() -> str: - """Generate the complete Catppuccin Mocha QSS stylesheet for FreeCAD. - - Returns: - str: Complete Qt stylesheet string. - """ - return f""" -/* ============================================================================= - Catppuccin Mocha Theme for FreeCAD - Bundled with ztools addon - https://catppuccin.com/ - ============================================================================= */ - -/* ============================================================================= - Global Defaults - ============================================================================= */ - -* {{ - color: {_text}; - font-family: "Segoe UI", "Ubuntu", "Noto Sans", sans-serif; -}} - -QWidget {{ - background-color: {_base}; - color: {_text}; - selection-background-color: {_surface2}; - selection-color: {_text}; -}} - -/* ============================================================================= - Main Window and MDI Area - ============================================================================= */ - -QMainWindow {{ - background-color: {_mantle}; -}} - -QMainWindow::separator {{ - background-color: {_surface0}; - width: 4px; - height: 4px; -}} - -QMainWindow::separator:hover {{ - background-color: {_mauve}; -}} - -QMdiArea {{ - background-color: {_crust}; -}} - -QMdiSubWindow {{ - background-color: {_base}; - border: 1px solid {_surface1}; -}} - -QMdiSubWindow > QWidget {{ - background-color: {_base}; -}} - -/* ============================================================================= - Menu Bar - ============================================================================= */ - -QMenuBar {{ - background-color: {_mantle}; - color: {_text}; - border-bottom: 1px solid {_surface0}; - padding: 2px; -}} - -QMenuBar::item {{ - background-color: transparent; - padding: 4px 8px; - border-radius: 4px; -}} - -QMenuBar::item:selected {{ - background-color: {_surface0}; -}} - -QMenuBar::item:pressed {{ - background-color: {_surface1}; -}} - -/* ============================================================================= - Menus - ============================================================================= */ - -QMenu {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 6px; - padding: 4px; -}} - -QMenu::item {{ - padding: 6px 24px 6px 8px; - border-radius: 4px; -}} - -QMenu::item:selected {{ - background-color: {_surface1}; - color: {_text}; -}} - -QMenu::item:disabled {{ - color: {_overlay0}; -}} - -QMenu::separator {{ - height: 1px; - background-color: {_surface1}; - margin: 4px 8px; -}} - -QMenu::icon {{ - margin-left: 8px; -}} - -QMenu::indicator {{ - width: 16px; - height: 16px; - margin-left: 4px; -}} - -/* ============================================================================= - Toolbars - ============================================================================= */ - -QToolBar {{ - background-color: {_mantle}; - border: none; - spacing: 2px; - padding: 2px; -}} - -QToolBar::handle {{ - background-color: {_surface1}; - width: 8px; - margin: 2px; - border-radius: 2px; -}} - -QToolBar::handle:horizontal {{ - width: 8px; -}} - -QToolBar::handle:vertical {{ - height: 8px; -}} - -QToolBar::separator {{ - background-color: {_surface1}; - width: 1px; - margin: 4px 2px; -}} - -/* ============================================================================= - Tool Buttons (Toolbar icons) - ============================================================================= */ - -QToolButton {{ - background-color: transparent; - border: 1px solid transparent; - border-radius: 4px; - padding: 4px; - margin: 1px; -}} - -QToolButton:hover {{ - background-color: {_surface0}; - border: 1px solid {_surface1}; -}} - -QToolButton:pressed {{ - background-color: {_surface1}; -}} - -QToolButton:checked {{ - background-color: {_surface1}; - border: 1px solid {_mauve}; -}} - -QToolButton:disabled {{ - color: {_overlay0}; -}} - -QToolButton[popupMode="1"] {{ - padding-right: 16px; -}} - -QToolButton::menu-button {{ - border: none; - width: 14px; -}} - -QToolButton::menu-arrow {{ - width: 10px; - height: 10px; -}} - -/* ============================================================================= - Push Buttons - ============================================================================= */ - -QPushButton {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 6px; - padding: 6px 16px; - min-height: 20px; -}} - -QPushButton:hover {{ - background-color: {_surface1}; - border-color: {_surface2}; -}} - -QPushButton:pressed {{ - background-color: {_surface2}; -}} - -QPushButton:checked {{ - background-color: {_mauve}; - color: {_crust}; - border-color: {_mauve}; -}} - -QPushButton:disabled {{ - background-color: {_surface0}; - color: {_overlay0}; - border-color: {_surface0}; -}} - -QPushButton:default {{ - border: 2px solid {_mauve}; -}} - -/* ============================================================================= - Dock Widgets - ============================================================================= */ - -QDockWidget {{ - background-color: {_base}; - color: {_text}; - titlebar-close-icon: none; - titlebar-normal-icon: none; -}} - -QDockWidget::title {{ - background-color: {_mantle}; - color: {_text}; - padding: 6px; - border-bottom: 1px solid {_surface0}; -}} - -QDockWidget::close-button, -QDockWidget::float-button {{ - background-color: transparent; - border: none; - padding: 2px; -}} - -QDockWidget::close-button:hover, -QDockWidget::float-button:hover {{ - background-color: {_surface0}; - border-radius: 4px; -}} - -/* ============================================================================= - Tab Widgets - ============================================================================= */ - -QTabWidget::pane {{ - background-color: {_base}; - border: 1px solid {_surface1}; - border-radius: 4px; - top: -1px; -}} - -QTabBar {{ - background-color: transparent; -}} - -QTabBar::tab {{ - background-color: {_surface0}; - color: {_subtext1}; - border: 1px solid {_surface1}; - padding: 6px 12px; - margin-right: 2px; - border-top-left-radius: 6px; - border-top-right-radius: 6px; -}} - -QTabBar::tab:selected {{ - background-color: {_base}; - color: {_text}; - border-bottom-color: {_base}; -}} - -QTabBar::tab:hover:!selected {{ - background-color: {_surface1}; - color: {_text}; -}} - -QTabBar::tab:disabled {{ - color: {_overlay0}; -}} - -QTabBar::close-button {{ - margin-left: 4px; -}} - -QTabBar::close-button:hover {{ - background-color: {_red}; - border-radius: 2px; -}} - -/* ============================================================================= - Scroll Bars - ============================================================================= */ - -QScrollBar:horizontal {{ - background-color: {_mantle}; - height: 12px; - margin: 0 12px 0 12px; - border-radius: 6px; -}} - -QScrollBar:vertical {{ - background-color: {_mantle}; - width: 12px; - margin: 12px 0 12px 0; - border-radius: 6px; -}} - -QScrollBar::handle:horizontal {{ - background-color: {_surface1}; - min-width: 20px; - border-radius: 5px; - margin: 1px; -}} - -QScrollBar::handle:vertical {{ - background-color: {_surface1}; - min-height: 20px; - border-radius: 5px; - margin: 1px; -}} - -QScrollBar::handle:horizontal:hover, -QScrollBar::handle:vertical:hover {{ - background-color: {_surface2}; -}} - -QScrollBar::add-line:horizontal, -QScrollBar::sub-line:horizontal, -QScrollBar::add-line:vertical, -QScrollBar::sub-line:vertical {{ - width: 12px; - height: 12px; - background-color: {_surface0}; - border-radius: 6px; -}} - -QScrollBar::add-line:horizontal:hover, -QScrollBar::sub-line:horizontal:hover, -QScrollBar::add-line:vertical:hover, -QScrollBar::sub-line:vertical:hover {{ - background-color: {_surface1}; -}} - -QScrollBar::add-page:horizontal, -QScrollBar::sub-page:horizontal, -QScrollBar::add-page:vertical, -QScrollBar::sub-page:vertical {{ - background-color: transparent; -}} - -/* ============================================================================= - Input Fields - ============================================================================= */ - -QLineEdit {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - padding: 4px 8px; - selection-background-color: {_mauve}; - selection-color: {_crust}; -}} - -QLineEdit:focus {{ - border-color: {_mauve}; -}} - -QLineEdit:disabled {{ - background-color: {_mantle}; - color: {_overlay0}; -}} - -QLineEdit:read-only {{ - background-color: {_mantle}; -}} - -QTextEdit, QPlainTextEdit {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - selection-background-color: {_mauve}; - selection-color: {_crust}; -}} - -QTextEdit:focus, QPlainTextEdit:focus {{ - border-color: {_mauve}; -}} - -/* ============================================================================= - Spin Boxes - ============================================================================= */ - -QSpinBox, QDoubleSpinBox {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - padding: 4px; - padding-right: 20px; -}} - -QSpinBox:focus, QDoubleSpinBox:focus {{ - border-color: {_mauve}; -}} - -QSpinBox:disabled, QDoubleSpinBox:disabled {{ - background-color: {_mantle}; - color: {_overlay0}; -}} - -QSpinBox::up-button, QDoubleSpinBox::up-button {{ - subcontrol-origin: border; - subcontrol-position: top right; - width: 16px; - border-left: 1px solid {_surface1}; - border-top-right-radius: 4px; - background-color: {_surface1}; -}} - -QSpinBox::down-button, QDoubleSpinBox::down-button {{ - subcontrol-origin: border; - subcontrol-position: bottom right; - width: 16px; - border-left: 1px solid {_surface1}; - border-bottom-right-radius: 4px; - background-color: {_surface1}; -}} - -QSpinBox::up-button:hover, QDoubleSpinBox::up-button:hover, -QSpinBox::down-button:hover, QDoubleSpinBox::down-button:hover {{ - background-color: {_surface2}; -}} - -QSpinBox::up-button:pressed, QDoubleSpinBox::up-button:pressed, -QSpinBox::down-button:pressed, QDoubleSpinBox::down-button:pressed {{ - background-color: {_mauve}; -}} - -QSpinBox::up-arrow, QDoubleSpinBox::up-arrow {{ - width: 8px; - height: 8px; -}} - -QSpinBox::down-arrow, QDoubleSpinBox::down-arrow {{ - width: 8px; - height: 8px; -}} - -/* ============================================================================= - Combo Boxes - ============================================================================= */ - -QComboBox {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - padding: 4px 8px; - padding-right: 24px; - min-height: 20px; -}} - -QComboBox:hover {{ - border-color: {_surface2}; -}} - -QComboBox:focus {{ - border-color: {_mauve}; -}} - -QComboBox:disabled {{ - background-color: {_mantle}; - color: {_overlay0}; -}} - -QComboBox::drop-down {{ - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border-left: 1px solid {_surface1}; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - background-color: {_surface1}; -}} - -QComboBox::drop-down:hover {{ - background-color: {_surface2}; -}} - -QComboBox::down-arrow {{ - width: 10px; - height: 10px; -}} - -QComboBox QAbstractItemView {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - selection-background-color: {_surface1}; - selection-color: {_text}; - outline: none; -}} - -QComboBox QAbstractItemView::item {{ - padding: 4px 8px; - min-height: 24px; -}} - -QComboBox QAbstractItemView::item:hover {{ - background-color: {_surface1}; -}} - -QComboBox QAbstractItemView::item:selected {{ - background-color: {_surface2}; -}} - -/* ============================================================================= - Check Boxes - ============================================================================= */ - -QCheckBox {{ - spacing: 8px; - color: {_text}; -}} - -QCheckBox:disabled {{ - color: {_overlay0}; -}} - -QCheckBox::indicator {{ - width: 18px; - height: 18px; - border: 2px solid {_surface2}; - border-radius: 4px; - background-color: {_surface0}; -}} - -QCheckBox::indicator:hover {{ - border-color: {_mauve}; -}} - -QCheckBox::indicator:checked {{ - background-color: {_mauve}; - border-color: {_mauve}; -}} - -QCheckBox::indicator:checked:disabled {{ - background-color: {_overlay0}; - border-color: {_overlay0}; -}} - -QCheckBox::indicator:disabled {{ - background-color: {_mantle}; - border-color: {_surface1}; -}} - -/* ============================================================================= - Radio Buttons - ============================================================================= */ - -QRadioButton {{ - spacing: 8px; - color: {_text}; -}} - -QRadioButton:disabled {{ - color: {_overlay0}; -}} - -QRadioButton::indicator {{ - width: 18px; - height: 18px; - border: 2px solid {_surface2}; - border-radius: 9px; - background-color: {_surface0}; -}} - -QRadioButton::indicator:hover {{ - border-color: {_mauve}; -}} - -QRadioButton::indicator:checked {{ - background-color: {_mauve}; - border-color: {_mauve}; -}} - -QRadioButton::indicator:checked:disabled {{ - background-color: {_overlay0}; - border-color: {_overlay0}; -}} - -QRadioButton::indicator:disabled {{ - background-color: {_mantle}; - border-color: {_surface1}; -}} - -/* ============================================================================= - Sliders - ============================================================================= */ - -QSlider::groove:horizontal {{ - height: 6px; - background-color: {_surface1}; - border-radius: 3px; -}} - -QSlider::groove:vertical {{ - width: 6px; - background-color: {_surface1}; - border-radius: 3px; -}} - -QSlider::handle:horizontal {{ - width: 16px; - height: 16px; - margin: -5px 0; - background-color: {_mauve}; - border-radius: 8px; -}} - -QSlider::handle:vertical {{ - width: 16px; - height: 16px; - margin: 0 -5px; - background-color: {_mauve}; - border-radius: 8px; -}} - -QSlider::handle:horizontal:hover, -QSlider::handle:vertical:hover {{ - background-color: {_lavender}; -}} - -QSlider::handle:horizontal:pressed, -QSlider::handle:vertical:pressed {{ - background-color: {_pink}; -}} - -QSlider::sub-page:horizontal {{ - background-color: {_mauve}; - border-radius: 3px; -}} - -QSlider::add-page:vertical {{ - background-color: {_mauve}; - border-radius: 3px; -}} - -/* ============================================================================= - Progress Bars - ============================================================================= */ - -QProgressBar {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - text-align: center; - height: 20px; -}} - -QProgressBar::chunk {{ - background-color: {_mauve}; - border-radius: 3px; -}} - -/* ============================================================================= - Group Boxes - ============================================================================= */ - -QGroupBox {{ - background-color: {_base}; - border: 1px solid {_surface1}; - border-radius: 6px; - margin-top: 12px; - padding-top: 8px; -}} - -QGroupBox::title {{ - subcontrol-origin: margin; - subcontrol-position: top left; - left: 12px; - padding: 0 4px; - color: {_subtext1}; - background-color: {_base}; -}} - -/* ============================================================================= - Tree View - ============================================================================= */ - -QTreeView {{ - background-color: {_base}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - outline: none; -}} - -QTreeView::item {{ - padding: 4px; - border-radius: 2px; -}} - -QTreeView::item:hover {{ - background-color: {_surface0}; -}} - -QTreeView::item:selected {{ - background-color: {_surface1}; - color: {_text}; -}} - -QTreeView::item:selected:active {{ - background-color: {_surface2}; -}} - -/* Branch indicators (collapse/expand arrows) - uses FreeCAD built-in light images for dark theme */ -QTreeView::branch {{ - background: transparent; -}} - -QTreeView::branch:has-siblings:!adjoins-item {{ - border-image: url(qss:images_dark-light/branch_vline_light.svg) 0; -}} - -QTreeView::branch:has-siblings:adjoins-item {{ - border-image: url(qss:images_dark-light/branch_more_light.svg) 0; -}} - -QTreeView::branch:!has-children:!has-siblings:adjoins-item {{ - border-image: url(qss:images_dark-light/branch_end_light.svg) 0; -}} - -QTreeView::branch:closed:has-children:has-siblings {{ - border-image: url(qss:images_dark-light/branch_more_closed_light.svg) 0; -}} - -QTreeView::branch:has-children:!has-siblings:closed {{ - border-image: url(qss:images_dark-light/branch_end_closed_light.svg) 0; -}} - -QTreeView::branch:open:has-children:has-siblings {{ - border-image: url(qss:images_dark-light/branch_more_open_light.svg) 0; -}} - -QTreeView::branch:open:has-children:!has-siblings {{ - border-image: url(qss:images_dark-light/branch_end_open_light.svg) 0; -}} - -/* ============================================================================= - List View - ============================================================================= */ - -QListView {{ - background-color: {_base}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - outline: none; -}} - -QListView::item {{ - padding: 4px; - border-radius: 2px; -}} - -QListView::item:hover {{ - background-color: {_surface0}; -}} - -QListView::item:selected {{ - background-color: {_surface1}; - color: {_text}; -}} - -/* ============================================================================= - Table View - ============================================================================= */ - -QTableView {{ - background-color: {_base}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - gridline-color: {_surface0}; - outline: none; -}} - -QTableView::item {{ - padding: 4px; -}} - -QTableView::item:hover {{ - background-color: {_surface0}; -}} - -QTableView::item:selected {{ - background-color: {_surface1}; - color: {_text}; -}} - -QTableView QTableCornerButton::section {{ - background-color: {_surface0}; - border: 1px solid {_surface1}; -}} - -/* ============================================================================= - Header Views (for Tables/Trees) - ============================================================================= */ - -QHeaderView {{ - background-color: {_surface0}; - border: none; -}} - -QHeaderView::section {{ - background-color: {_surface0}; - color: {_subtext1}; - border: none; - border-right: 1px solid {_surface1}; - border-bottom: 1px solid {_surface1}; - padding: 6px 8px; -}} - -QHeaderView::section:hover {{ - background-color: {_surface1}; - color: {_text}; -}} - -QHeaderView::section:checked {{ - background-color: {_surface1}; -}} - -QHeaderView::down-arrow {{ - width: 10px; - height: 10px; -}} - -QHeaderView::up-arrow {{ - width: 10px; - height: 10px; -}} - -/* ============================================================================= - Splitters - ============================================================================= */ - -QSplitter::handle {{ - background-color: {_surface0}; -}} - -QSplitter::handle:horizontal {{ - width: 4px; -}} - -QSplitter::handle:vertical {{ - height: 4px; -}} - -QSplitter::handle:hover {{ - background-color: {_mauve}; -}} - -/* ============================================================================= - Status Bar - ============================================================================= */ - -QStatusBar {{ - background-color: {_mantle}; - color: {_subtext1}; - border-top: 1px solid {_surface0}; -}} - -QStatusBar::item {{ - border: none; -}} - -QStatusBar QLabel {{ - padding: 2px 8px; -}} - -/* ============================================================================= - Tooltips - ============================================================================= */ - -QToolTip {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - padding: 4px 8px; -}} - -/* ============================================================================= - Labels - ============================================================================= */ - -QLabel {{ - color: {_text}; - background-color: transparent; -}} - -QLabel:disabled {{ - color: {_overlay0}; -}} - -/* ============================================================================= - Frames - ============================================================================= */ - -QFrame {{ - border: none; -}} - -QFrame[frameShape="4"] {{ - /* HLine */ - background-color: {_surface1}; - max-height: 1px; -}} - -QFrame[frameShape="5"] {{ - /* VLine */ - background-color: {_surface1}; - max-width: 1px; -}} - -/* ============================================================================= - Tool Box (Collapsible sections) - ============================================================================= */ - -QToolBox {{ - background-color: {_base}; - border: 1px solid {_surface1}; - border-radius: 4px; -}} - -QToolBox::tab {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - padding: 8px; -}} - -QToolBox::tab:selected {{ - background-color: {_surface1}; - border-color: {_mauve}; -}} - -QToolBox::tab:hover {{ - background-color: {_surface1}; -}} - -/* ============================================================================= - Dialog Buttons - ============================================================================= */ - -QDialogButtonBox {{ - button-layout: 0; -}} - -/* ============================================================================= - Date/Time Edits - ============================================================================= */ - -QDateEdit, QTimeEdit, QDateTimeEdit {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - padding: 4px; -}} - -QDateEdit:focus, QTimeEdit:focus, QDateTimeEdit:focus {{ - border-color: {_mauve}; -}} - -QDateEdit::drop-down, QTimeEdit::drop-down, QDateTimeEdit::drop-down {{ - subcontrol-origin: padding; - subcontrol-position: top right; - width: 20px; - border-left: 1px solid {_surface1}; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - background-color: {_surface1}; -}} - -QCalendarWidget {{ - background-color: {_base}; -}} - -QCalendarWidget QToolButton {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - margin: 2px; -}} - -QCalendarWidget QToolButton:hover {{ - background-color: {_surface1}; -}} - -QCalendarWidget QMenu {{ - background-color: {_surface0}; -}} - -QCalendarWidget QSpinBox {{ - background-color: {_surface0}; -}} - -QCalendarWidget QAbstractItemView {{ - background-color: {_base}; - selection-background-color: {_mauve}; - selection-color: {_crust}; -}} - -/* ============================================================================= - Wizard - ============================================================================= */ - -QWizard {{ - background-color: {_base}; -}} - -QWizard QLabel {{ - color: {_text}; -}} - -/* ============================================================================= - FreeCAD Specific Widgets - ============================================================================= */ - -/* Property Editor */ -Gui--PropertyEditor--PropertyEditor {{ - background-color: {_base}; - color: {_text}; - border: 1px solid {_surface1}; - qproperty-groupBackground: {_surface0}; - qproperty-groupTextColor: {_subtext1}; - qproperty-itemBackground: {_base}; -}} - -Gui--PropertyEditor--PropertyEditor QLineEdit {{ - background-color: {_surface0}; - border: 1px solid {_surface1}; -}} - -Gui--PropertyEditor--PropertyEditor QComboBox {{ - background-color: {_surface0}; -}} - -/* Color Button */ -Gui--ColorButton {{ - background-color: {_surface0}; - border: 1px solid {_surface1}; - border-radius: 4px; - padding: 2px; -}} - -Gui--ColorButton:hover {{ - border-color: {_mauve}; -}} - -/* Workbench Selector */ -Gui--WorkbenchComboBox {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; - padding: 4px 8px; -}} - -Gui--WorkbenchComboBox:hover {{ - border-color: {_surface2}; -}} - -Gui--WorkbenchComboBox::drop-down {{ - background-color: {_surface1}; - border-left: 1px solid {_surface1}; - border-radius: 0 4px 4px 0; -}} - -/* Task Panel */ -QSint--ActionGroup {{ - background-color: {_surface0}; - border: 1px solid {_surface1}; - border-radius: 6px; -}} - -QSint--ActionGroup QToolButton {{ - background-color: {_surface0}; - color: {_text}; - border: none; - border-radius: 4px; - padding: 6px; -}} - -QSint--ActionGroup QToolButton:hover {{ - background-color: {_surface1}; -}} - -QSint--ActionGroup QFrame {{ - background-color: {_base}; - border: none; - border-radius: 4px; -}} - -/* Input Field */ -Gui--InputField {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; - border-radius: 4px; -}} - -Gui--InputField:focus {{ - border-color: {_mauve}; -}} - -/* Expression Completer */ -Gui--ExpressionCompleter {{ - background-color: {_surface0}; - color: {_text}; - border: 1px solid {_surface1}; -}} - -/* Spreadsheet */ -SpreadsheetGui--SheetTableView {{ - background-color: {_base}; - color: {_text}; - gridline-color: {_surface1}; - selection-background-color: {_surface1}; - selection-color: {_text}; -}} - -SpreadsheetGui--SheetTableView QHeaderView::section {{ - background-color: {_surface0}; - color: {_subtext1}; - border: 1px solid {_surface1}; - padding: 4px; -}} - -SpreadsheetGui--SheetTableView::item {{ - color: {_text}; - background-color: {_base}; -}} - -SpreadsheetGui--SheetTableView::item:selected {{ - color: {_text}; - background-color: {_surface1}; -}} - -SpreadsheetGui--SheetTableView::item:focus {{ - color: {_text}; -}} - -/* Spreadsheet cell editor */ -SpreadsheetGui--SheetTableView QLineEdit {{ - color: {_text}; - background-color: {_surface0}; - border: 1px solid {_mauve}; - selection-background-color: {_mauve}; - selection-color: {_crust}; -}} - -/* Spreadsheet module - additional selectors for cell content */ -Spreadsheet--SheetModel {{ - color: {_text}; -}} - -SpreadsheetGui--SheetView {{ - background-color: {_base}; - color: {_text}; -}} - -SpreadsheetGui--SheetView::item {{ - color: {_text}; -}} - -/* Python Console */ -Gui--PythonConsole {{ - background-color: {_crust}; - color: {_text}; - font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace; - selection-background-color: {_surface1}; -}} - -/* Python Editor */ -Gui--PythonEditor {{ - background-color: {_crust}; - color: {_text}; - font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace; - selection-background-color: {_mauve}; - selection-color: {_crust}; -}} - -/* Report View */ -Gui--DockWnd--ReportOutput {{ - background-color: {_crust}; - color: {_text}; - font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace; -}} - -/* DAG View */ -Gui--DAG--Model {{ - background-color: {_base}; -}} - -/* ============================================================================= - Sketcher Specific Styles - ============================================================================= */ - -/* Sketcher constraint colors are handled via preferences, not QSS */ - -/* ============================================================================= - Syntax Highlighting Colors (Python Editor) - Note: These are typically set via FreeCAD preferences, but we define them here - for reference and any widgets that support them. - ============================================================================= */ - -/* - Python Editor Syntax Colors (Catppuccin Mocha): - - Comment: {_overlay1} - - Number: {_peach} - - String: {_green} - - Keyword: {_mauve} - - Class/Def name: {_blue} - - Operator: {_sky} - - Output: {_text} - - Error: {_red} -*/ - -/* ============================================================================= - Custom Color Accents by Context - ============================================================================= */ - -/* Success states */ -*[state="success"] {{ - color: {_green}; -}} - -/* Warning states */ -*[state="warning"] {{ - color: {_yellow}; -}} - -/* Error states */ -*[state="error"] {{ - color: {_red}; -}} - -/* Info states */ -*[state="info"] {{ - color: {_blue}; -}} -""" - - -def get_stylesheet() -> str: - """Get the Catppuccin Mocha stylesheet. - - Returns: - str: Complete QSS stylesheet. - """ - return generate_stylesheet() - - -def apply_spreadsheet_colors(): - """Apply Catppuccin Mocha colors to FreeCAD Spreadsheet preferences. - - FreeCAD's Spreadsheet module uses internal preference settings for colors - rather than pure QSS styling. This function sets those preferences to - match the Catppuccin Mocha theme. - """ - import FreeCAD as App - - # Get the parameter group for Spreadsheet colors - params = App.ParamGet("User parameter:BaseApp/Preferences/Mod/Spreadsheet") - - # Convert hex color to unsigned int (FreeCAD stores colors as unsigned 32-bit RGBA) - def hex_to_rgba_uint(hex_color: str) -> int: - """Convert hex color (#RRGGBB) to FreeCAD's unsigned int format (0xRRGGBBAA).""" - hex_color = hex_color.lstrip("#") - r = int(hex_color[0:2], 16) - g = int(hex_color[2:4], 16) - b = int(hex_color[4:6], 16) - a = 255 # Full opacity - # FreeCAD uses RGBA format as unsigned int - return (r << 24) | (g << 16) | (b << 8) | a - - # Set text/foreground color to Catppuccin Mocha "text" (#cdd6f4) - text_color = hex_to_rgba_uint(MOCHA["text"]) - params.SetUnsigned("TextColor", text_color) - - # Set background colors - bg_color = hex_to_rgba_uint(MOCHA["base"]) - params.SetUnsigned("BackgroundColor", bg_color) - - # Alternate row background - alt_bg_color = hex_to_rgba_uint(MOCHA["surface0"]) - params.SetUnsigned("AltBackgroundColor", alt_bg_color) - - # Alias text color (for cells with aliases) - use teal for distinction - alias_color = hex_to_rgba_uint(MOCHA["teal"]) - params.SetUnsigned("AliasedTextColor", alias_color) - - # Positive number color - green - positive_color = hex_to_rgba_uint(MOCHA["green"]) - params.SetUnsigned("PositiveNumberColor", positive_color) - - # Negative number color - red - negative_color = hex_to_rgba_uint(MOCHA["red"]) - params.SetUnsigned("NegativeNumberColor", negative_color) - - App.Console.PrintLog("ztools: Applied Catppuccin Mocha spreadsheet colors\n")