Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pop-os/cosmic-term
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Aug 19, 2024
2 parents 193746f + 8c55fef commit fbb69fd
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 44 deletions.
59 changes: 31 additions & 28 deletions i18n/de/cosmic_term.ftl
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
cosmic-terminal = COSMIC Terminal
new-terminal = Neues Terminal
# Context Pages
# Kontextseiten

## About
git-description = Git commit {$hash} vom {$date}
## Über
git-description = Git-Commit {$hash} am {$date}
## Color schemes
## Farbschemen
color-schemes = Farbschemen
rename = Umbenennen
export = Exportieren
delete = Löschen
import = Importieren
import-errors = Importfehler
## Profiles
## Profile
profiles = Profile
name = Name
command-line = Startbefehl
tab-title = Überschrift
command-line = Befehlszeile
tab-title = Tab-Titel
tab-title-description = Standardtitel des Tabs überschreiben
add-profile = Profil hinzufügen
new-profile = Neues Profil
make-default = Als Standard setzen
make-default = Als Standard festlegen
working-directory = Arbeitsverzeichnis
hold = Halten
remain-open = Nach Beendigung des Kindprozesses offen bleiben.
## Settings
## Einstellungen
settings = Einstellungen
### Appearance
### Aussehen
appearance = Aussehen
theme = Thema
match-desktop = An System anpassen
Expand All @@ -38,8 +41,8 @@ syntax-light = Helles Farbschema
default-zoom-step = Zoomstufen
opacity = Deckkraft des Hintergrundes
### Font
font = Schrift
### Schriftart
font = Schriftart
advanced-font-settings = Fortgeschrittene Schrifteinstellungen
default-font = Schriftart
default-font-size = Schriftgröße
Expand All @@ -49,23 +52,23 @@ default-dim-font-weight = Matte Schriftstärke
default-bold-font-weight = Fette Schriftstärke
use-bright-bold = Fetten Text heller darstellen
### Splits
### Aufteilungen
splits = Aufteilungen
focus-follow-mouse = Tippen folgt Maus
focus-follow-mouse = Tippfokus folgt Maus
### Advanced
### Fortgeschritten
advanced = Fortgeschritten
show-headerbar = Kopfzeile anzeigen
show-header-description = Kopfzeile kann via Rechtsklickmenü angezeigt werden
show-header-description = Kopfzeile über das Rechtsklickmenü einblenden.
# Find
find-placeholder = Suche...
find-previous = Vorheriges
find-next = Nächstes
# Suchen
find-placeholder = Suchen...
find-previous = Vorherigen suchen
find-next = Nächsten suchen
# Menu
# Menü

## File
## Datei
file = Datei
new-tab = Neuer Tab
new-window = Neues Fenster
Expand All @@ -74,23 +77,23 @@ menu-profiles = Profile...
close-tab = Tab schließen
quit = Beenden
## Edit
## Bearbeiten
edit = Bearbeiten
copy = Kopieren
paste = Einfügen
select-all = Alles auswählen
find = Suche
find = Suchen
## View
## Ansicht
view = Ansicht
zoom-in = Schrift vergrößern
zoom-in = Größerer Text
zoom-reset = Standardschriftgröße
zoom-out = Schrift verkleinern
zoom-out = Kleinerer Text
next-tab = Nächster Tab
previous-tab = Vorheriger Tab
split-horizontal = Horizontal aufteilen
split-vertical = Vertikal aufteilen
pane-toggle-maximize = Vollbild umschalten
menu-color-schemes = Farbthemen...
menu-color-schemes = Farbschemen...
menu-settings = Einstellungen...
menu-about = Über COSMIC Terminal...
6 changes: 3 additions & 3 deletions i18n/hu/cosmic_term.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ select-all = Minden kijelölése
find = Keresés
## View
view = Nézed
zoom-in = Nagyobb szöveg
view = Nézet
zoom-in = Nagyobb szövegméret
zoom-reset = Alapértelmezett szövegméret
zoom-out = Kisebb szöveg
zoom-out = Kisebb szövegméret
next-tab = Következő lap
previous-tab = Előző lap
split-horizontal = Vízszintes felosztás
Expand Down
34 changes: 21 additions & 13 deletions src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,31 +580,39 @@ impl Terminal {
}
}

//TODO: this is done on every set_config because the changed boolean above does not capture
// NOTE: this is done on every set_config because the changed boolean above does not capture
// WINDOW_BG changes
self.update_colors(config);
let default_colors_updated = self.update_default_colors(config);

if update_cell_size {
self.update_cell_size();
} else if update {
} else if update || default_colors_updated {
self.update();
}
}

pub fn update_colors(&mut self, config: &AppConfig) {
self.metadata_set.clear();
pub fn update_default_colors(&mut self, config: &AppConfig) -> bool {
let default_bg = convert_color(&self.colors, Color::Named(NamedColor::Background));
let default_fg = convert_color(&self.colors, Color::Named(NamedColor::Foreground));

let default_metadata = Metadata::new(default_bg, default_fg);
let (default_metadata_idx, _) = self.metadata_set.insert_full(default_metadata);
let new_default_metadata = Metadata::new(default_bg, default_fg);
let curr_metada_idx = self.default_attrs().metadata;

self.default_attrs = Attrs::new()
.family(Family::Monospace)
.weight(Weight(config.font_weight))
.stretch(config.typed_font_stretch())
.color(default_fg)
.metadata(default_metadata_idx);
let updated = new_default_metadata != self.metadata_set[curr_metada_idx];

if updated {
self.metadata_set.clear();
let (default_metadata_idx, _) = self.metadata_set.insert_full(new_default_metadata);

self.default_attrs = Attrs::new()
.family(Family::Monospace)
.weight(Weight(config.font_weight))
.stretch(config.typed_font_stretch())
.color(default_fg)
.metadata(default_metadata_idx);
}

updated
}

pub fn update_cell_size(&mut self) {
Expand Down

0 comments on commit fbb69fd

Please sign in to comment.