Merge branch 'master' into primary
This commit is contained in:
commit
47689a58bf
6 changed files with 89 additions and 12 deletions
|
|
@ -1,5 +1,29 @@
|
||||||
|
cosmic-terminal = Терминал COSMIC
|
||||||
|
new-terminal = Новый терминал
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
||||||
|
## About
|
||||||
|
git-description = Git-коммит {$hash} от {$date}
|
||||||
|
|
||||||
|
## Color schemes
|
||||||
|
color-schemes = Цветовые схемы
|
||||||
|
rename = Переименовать
|
||||||
|
export = Экспортировать
|
||||||
|
delete = Удалить
|
||||||
|
import = Импортировать
|
||||||
|
import-errors = Ошибки при импорте
|
||||||
|
|
||||||
|
## Profiles
|
||||||
|
profiles = Профили
|
||||||
|
name = Имя
|
||||||
|
command-line = Командная строка
|
||||||
|
tab-title = Заголовок вкладки
|
||||||
|
tab-title-description = Переопределить заголовок вкладки по умолчанию
|
||||||
|
add-profile = Добавить профиль
|
||||||
|
new-profile = Новый профиль
|
||||||
|
make-default = Установить по умолчанию
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
settings = Параметры
|
settings = Параметры
|
||||||
|
|
||||||
|
|
@ -12,6 +36,7 @@ light = Светлая
|
||||||
syntax-dark = Цветовая схема темная
|
syntax-dark = Цветовая схема темная
|
||||||
syntax-light = Цветовая схема светлая
|
syntax-light = Цветовая схема светлая
|
||||||
default-zoom-step = Шаги масштабирования
|
default-zoom-step = Шаги масштабирования
|
||||||
|
opacity = Прозрачность фона
|
||||||
|
|
||||||
### Font
|
### Font
|
||||||
font = Шрифт
|
font = Шрифт
|
||||||
|
|
@ -44,6 +69,8 @@ find-next = Найти далее
|
||||||
file = Файл
|
file = Файл
|
||||||
new-tab = Новая вкладка
|
new-tab = Новая вкладка
|
||||||
new-window = Новое окно
|
new-window = Новое окно
|
||||||
|
profile = Профиль
|
||||||
|
menu-profiles = Профили...
|
||||||
close-tab = Закрыть вкладку
|
close-tab = Закрыть вкладку
|
||||||
quit = Завершить
|
quit = Завершить
|
||||||
|
|
||||||
|
|
@ -64,4 +91,6 @@ previous-tab = Предыдущая вкладка
|
||||||
split-horizontal = Разделение по горизонтали
|
split-horizontal = Разделение по горизонтали
|
||||||
split-vertical = Разделение по вертикали
|
split-vertical = Разделение по вертикали
|
||||||
pane-toggle-maximize = Переключить на весь экран
|
pane-toggle-maximize = Переключить на весь экран
|
||||||
|
menu-color-schemes = Цветовые схемы...
|
||||||
menu-settings = Параметры...
|
menu-settings = Параметры...
|
||||||
|
menu-about = О Терминале COSMIC...
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,33 @@
|
||||||
# Context sidor
|
cosmic-terminal = COSMIC Terminal
|
||||||
|
new-terminal = Ny terminal
|
||||||
|
|
||||||
## Settings
|
# Context Pages
|
||||||
|
|
||||||
|
## Om
|
||||||
|
git-description = Git commit {$hash} på {$date}
|
||||||
|
|
||||||
|
## Färgscheman
|
||||||
|
color-schemes = Färgscheman
|
||||||
|
rename = Byt namn
|
||||||
|
export = Exportera
|
||||||
|
delete = Ta bort
|
||||||
|
import = Importera
|
||||||
|
import-errors = Fel vid import
|
||||||
|
|
||||||
|
## Profiler
|
||||||
|
profiles = Profiler
|
||||||
|
name = Namn
|
||||||
|
command-line = Kommandorad
|
||||||
|
tab-title = Titel på flik
|
||||||
|
tab-title-description = Åsidosätt standardtitel för flik
|
||||||
|
add-profile = Lägg till profil
|
||||||
|
new-profile = Ny profil
|
||||||
|
make-default = Gör till standard
|
||||||
|
|
||||||
|
## Inställningar
|
||||||
settings = Inställningar
|
settings = Inställningar
|
||||||
|
|
||||||
### Appearance
|
### Utseende
|
||||||
appearance = Utseende
|
appearance = Utseende
|
||||||
theme = Tema
|
theme = Tema
|
||||||
match-desktop = Matcha skrivbordet
|
match-desktop = Matcha skrivbordet
|
||||||
|
|
@ -12,6 +36,7 @@ light = Ljust
|
||||||
syntax-dark = Färgschema mörkt
|
syntax-dark = Färgschema mörkt
|
||||||
syntax-light = Färgschema ljust
|
syntax-light = Färgschema ljust
|
||||||
default-zoom-step = Zoom steg
|
default-zoom-step = Zoom steg
|
||||||
|
opacity = Bakgrundens opacitet
|
||||||
|
|
||||||
### Teckensnitt
|
### Teckensnitt
|
||||||
font = Teckensnitt
|
font = Teckensnitt
|
||||||
|
|
@ -44,6 +69,8 @@ find-next = Hitta nästa
|
||||||
file = Fil
|
file = Fil
|
||||||
new-tab = Ny flik
|
new-tab = Ny flik
|
||||||
new-window = Nytt fönster
|
new-window = Nytt fönster
|
||||||
|
profile = Profil
|
||||||
|
menu-profiles = Profiler…
|
||||||
close-tab = Stäng flik
|
close-tab = Stäng flik
|
||||||
quit = Avsluta
|
quit = Avsluta
|
||||||
|
|
||||||
|
|
@ -64,4 +91,6 @@ previous-tab = Föregående flik
|
||||||
split-horizontal = Dela horisontellt
|
split-horizontal = Dela horisontellt
|
||||||
split-vertical = Dela vertikalt
|
split-vertical = Dela vertikalt
|
||||||
pane-toggle-maximize = Växla maximerad
|
pane-toggle-maximize = Växla maximerad
|
||||||
|
menu-color-schemes = Färgscheman…
|
||||||
menu-settings = Inställningar…
|
menu-settings = Inställningar…
|
||||||
|
menu-about = Om COSMIC Terminal…
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ use std::sync::OnceLock;
|
||||||
use crate::fl;
|
use crate::fl;
|
||||||
|
|
||||||
pub const CONFIG_VERSION: u64 = 1;
|
pub const CONFIG_VERSION: u64 = 1;
|
||||||
|
pub const COSMIC_THEME_DARK: &str = "COSMIC Dark";
|
||||||
|
pub const COSMIC_THEME_LIGHT: &str = "COSMIC Light";
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
|
||||||
pub enum AppTheme {
|
pub enum AppTheme {
|
||||||
|
|
@ -193,8 +195,8 @@ impl Default for Profile {
|
||||||
Self {
|
Self {
|
||||||
name: fl!("new-profile"),
|
name: fl!("new-profile"),
|
||||||
command: String::new(),
|
command: String::new(),
|
||||||
syntax_theme_dark: "COSMIC Dark".to_string(),
|
syntax_theme_dark: COSMIC_THEME_DARK.to_string(),
|
||||||
syntax_theme_light: "COSMIC Light".to_string(),
|
syntax_theme_light: COSMIC_THEME_LIGHT.to_string(),
|
||||||
tab_title: String::new(),
|
tab_title: String::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -239,8 +241,8 @@ impl Default for Config {
|
||||||
opacity: 100,
|
opacity: 100,
|
||||||
profiles: BTreeMap::new(),
|
profiles: BTreeMap::new(),
|
||||||
show_headerbar: true,
|
show_headerbar: true,
|
||||||
syntax_theme_dark: "COSMIC Dark".to_string(),
|
syntax_theme_dark: COSMIC_THEME_DARK.to_string(),
|
||||||
syntax_theme_light: "COSMIC Light".to_string(),
|
syntax_theme_light: COSMIC_THEME_LIGHT.to_string(),
|
||||||
use_bright_bold: false,
|
use_bright_bold: false,
|
||||||
default_profile: None,
|
default_profile: None,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
src/main.rs
14
src/main.rs
|
|
@ -1143,7 +1143,19 @@ impl App {
|
||||||
self.pane_model.focus = pane;
|
self.pane_model.focus = pane;
|
||||||
match &self.term_event_tx_opt {
|
match &self.term_event_tx_opt {
|
||||||
Some(term_event_tx) => {
|
Some(term_event_tx) => {
|
||||||
match self.themes.get(&self.config.syntax_theme(profile_id_opt)) {
|
let colors = self
|
||||||
|
.themes
|
||||||
|
.get(&self.config.syntax_theme(profile_id_opt))
|
||||||
|
.or_else(|| match self.config.color_scheme_kind() {
|
||||||
|
ColorSchemeKind::Dark => self
|
||||||
|
.themes
|
||||||
|
.get(&(config::COSMIC_THEME_DARK.to_string(), ColorSchemeKind::Dark)),
|
||||||
|
ColorSchemeKind::Light => self.themes.get(&(
|
||||||
|
config::COSMIC_THEME_LIGHT.to_string(),
|
||||||
|
ColorSchemeKind::Light,
|
||||||
|
)),
|
||||||
|
});
|
||||||
|
match colors {
|
||||||
Some(colors) => {
|
Some(colors) => {
|
||||||
let current_pane = self.pane_model.focus;
|
let current_pane = self.pane_model.focus;
|
||||||
if let Some(tab_model) = self.pane_model.active_mut() {
|
if let Some(tab_model) = self.pane_model.active_mut() {
|
||||||
|
|
|
||||||
|
|
@ -572,11 +572,14 @@ impl Terminal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if changed {
|
if changed {
|
||||||
self.update_colors(config);
|
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: this is done on every set_config because the changed boolean above does not capture
|
||||||
|
// WINDOW_BG changes
|
||||||
|
self.update_colors(config);
|
||||||
|
|
||||||
if update_cell_size {
|
if update_cell_size {
|
||||||
self.update_cell_size();
|
self.update_cell_size();
|
||||||
} else if update {
|
} else if update {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@ use hex_color::HexColor;
|
||||||
use palette::{encoding::Srgb, rgb::Rgb as PRgb, FromColor, Okhsl};
|
use palette::{encoding::Srgb, rgb::Rgb as PRgb, FromColor, Okhsl};
|
||||||
use std::{collections::HashMap, fs};
|
use std::{collections::HashMap, fs};
|
||||||
|
|
||||||
use crate::config::{ColorScheme, ColorSchemeAnsi, ColorSchemeKind};
|
use crate::config::{
|
||||||
|
ColorScheme, ColorSchemeAnsi, ColorSchemeKind, COSMIC_THEME_DARK, COSMIC_THEME_LIGHT,
|
||||||
|
};
|
||||||
|
|
||||||
// Fill missing dim/bright colors with derived values from normal ones.
|
// Fill missing dim/bright colors with derived values from normal ones.
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
|
@ -338,11 +340,11 @@ fn cosmic_light() -> Colors {
|
||||||
pub fn terminal_themes() -> HashMap<(String, ColorSchemeKind), Colors> {
|
pub fn terminal_themes() -> HashMap<(String, ColorSchemeKind), Colors> {
|
||||||
let mut themes = HashMap::new();
|
let mut themes = HashMap::new();
|
||||||
themes.insert(
|
themes.insert(
|
||||||
("COSMIC Dark".to_string(), ColorSchemeKind::Dark),
|
(COSMIC_THEME_DARK.to_string(), ColorSchemeKind::Dark),
|
||||||
cosmic_dark(),
|
cosmic_dark(),
|
||||||
);
|
);
|
||||||
themes.insert(
|
themes.insert(
|
||||||
("COSMIC Light".to_string(), ColorSchemeKind::Light),
|
(COSMIC_THEME_LIGHT.to_string(), ColorSchemeKind::Light),
|
||||||
cosmic_light(),
|
cosmic_light(),
|
||||||
);
|
);
|
||||||
themes
|
themes
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue