Files
clide/src/gui/colors.rs

116 lines
4.3 KiB
Rust
Raw Normal View History

2026-01-31 08:02:16 -05:00
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
//
// SPDX-License-Identifier: GNU General Public License v3.0 or later
2026-01-25 20:57:36 +00:00
#[cxx_qt::bridge]
2026-01-31 08:02:16 -05:00
2026-01-25 20:57:36 +00:00
pub mod qobject {
unsafe extern "C++" {
include!("cxx-qt-lib/qcolor.h");
type QColor = cxx_qt_lib::QColor;
}
unsafe extern "RustQt" {
#[qobject]
#[qml_element]
#[qml_singleton]
#[qproperty(QColor, hovered)]
#[qproperty(QColor, unhovered)]
#[qproperty(QColor, pressed)]
#[qproperty(QColor, menubar)]
#[qproperty(QColor, menubar_border)]
#[qproperty(QColor, scrollbar)]
#[qproperty(QColor, scrollbar_active)]
#[qproperty(QColor, scrollbar_gutter)]
#[qproperty(QColor, linenumber)]
#[qproperty(QColor, active)]
#[qproperty(QColor, inactive)]
#[qproperty(QColor, editor_background)]
#[qproperty(QColor, editor_text)]
#[qproperty(QColor, editor_highlighted_text)]
#[qproperty(QColor, editor_highlight)]
#[qproperty(QColor, gutter)]
#[qproperty(QColor, explorer_hovered)]
#[qproperty(QColor, explorer_text)]
#[qproperty(QColor, explorer_text_selected)]
#[qproperty(QColor, explorer_background)]
#[qproperty(QColor, explorer_folder)]
#[qproperty(QColor, explorer_folder_open)]
#[qproperty(QColor, terminal_background)]
2026-02-01 20:20:39 -05:00
#[qproperty(QColor, info_log)]
#[qproperty(QColor, debug_log)]
#[qproperty(QColor, warn_log)]
#[qproperty(QColor, error_log)]
2026-02-02 18:01:53 -05:00
#[qproperty(QColor, trace_log)]
2026-01-25 20:57:36 +00:00
type RustColors = super::RustColorsImpl;
}
}
use cxx_qt_lib::QColor;
pub struct RustColorsImpl {
hovered: QColor,
unhovered: QColor,
pressed: QColor,
menubar: QColor,
menubar_border: QColor,
scrollbar: QColor,
scrollbar_active: QColor,
scrollbar_gutter: QColor,
linenumber: QColor,
active: QColor,
inactive: QColor,
editor_background: QColor,
editor_text: QColor,
editor_highlighted_text: QColor,
editor_highlight: QColor,
gutter: QColor,
explorer_hovered: QColor,
explorer_text: QColor,
explorer_text_selected: QColor,
explorer_background: QColor,
explorer_folder: QColor,
explorer_folder_open: QColor,
terminal_background: QColor,
2026-02-01 20:20:39 -05:00
info_log: QColor,
debug_log: QColor,
warn_log: QColor,
error_log: QColor,
2026-02-02 18:01:53 -05:00
trace_log: QColor,
2026-01-25 20:57:36 +00:00
}
impl Default for RustColorsImpl {
fn default() -> Self {
Self {
hovered: QColor::try_from("#303234").unwrap(),
unhovered: QColor::try_from("#3c3f41").unwrap(),
pressed: QColor::try_from("#4b4f51").unwrap(),
2026-02-01 18:40:00 -05:00
menubar: QColor::try_from("#262626").unwrap(),
2026-01-25 20:57:36 +00:00
menubar_border: QColor::try_from("#575757").unwrap(),
scrollbar: QColor::try_from("#4b4f51").unwrap(),
scrollbar_active: QColor::try_from("#4b4f51").unwrap(),
scrollbar_gutter: QColor::try_from("#3b3b3b").unwrap(),
linenumber: QColor::try_from("#94989b").unwrap(),
active: QColor::try_from("#a9acb0").unwrap(),
inactive: QColor::try_from("#FFF").unwrap(),
2026-02-01 20:20:39 -05:00
editor_background: QColor::try_from("#111111").unwrap(),
2026-01-25 20:57:36 +00:00
editor_text: QColor::try_from("#acaea3").unwrap(),
editor_highlighted_text: QColor::try_from("#ccced3").unwrap(),
editor_highlight: QColor::try_from("#ccced3").unwrap(),
gutter: QColor::try_from("#1e1f22").unwrap(),
explorer_hovered: QColor::try_from("#4c5053").unwrap(),
explorer_text: QColor::try_from("#FFF").unwrap(),
2026-02-01 15:35:40 -05:00
explorer_text_selected: QColor::try_from("#262626").unwrap(),
explorer_background: QColor::try_from("#1E1F22").unwrap(),
2026-01-25 20:57:36 +00:00
explorer_folder: QColor::try_from("#54585b").unwrap(),
2026-02-07 12:42:56 -05:00
explorer_folder_open: QColor::try_from("#393B40").unwrap(),
2026-02-01 20:20:39 -05:00
terminal_background: QColor::try_from("#111111").unwrap(),
info_log: QColor::try_from("#C4FFFF").unwrap(),
2026-02-02 18:01:53 -05:00
debug_log: QColor::try_from("#9148AF").unwrap(),
warn_log: QColor::try_from("#C4A958").unwrap(),
2026-02-01 20:20:39 -05:00
error_log: QColor::try_from("#ff5555").unwrap(),
2026-02-02 18:01:53 -05:00
trace_log: QColor::try_from("#ffaa00").unwrap(),
2026-01-25 20:57:36 +00:00
}
}
}