feat(command-line): adjustable command line opacity

COMMANDLINEOPACITY (20-100 percent, default 100) and a slider under
Options > Display make the floating command line's panels see-through,
so the drawing stays visible behind it. The input field stays opaque
for legibility. The value is an application setting that persists.

Refs #1494

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-13 15:46:28 +03:00
1 parent 5a6f69f3f8
commit 5dd05bca18
32 files changed
+98 -5

No files matched your search

+1
View File
@@ -294,6 +294,7 @@ command-copy =
.mode = COPY أدخل خيار وضع النسخ [Single/Multiple] <Multiple>: .mode = COPY أدخل خيار وضع النسخ [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = شفافية سطر الأوامر
.txtexp-no-text-selected = TXTEXP: لم يتم تحديد نص. .txtexp-no-text-selected = TXTEXP: لم يتم تحديد نص.
.angle-override-shown = تجاوز الزاوية: __ocs_fmt_0__ .angle-override-shown = تجاوز الزاوية: __ocs_fmt_0__
.plot-preview-task = معاينة الطباعة .plot-preview-task = معاينة الطباعة
+1
View File
@@ -281,6 +281,7 @@ command-copy =
.displacement = COPY Задайте преместване: .displacement = COPY Задайте преместване:
.mode = COPY Въведете режим на копиране [Single/Multiple] <Multiple>: .mode = COPY Въведете режим на копиране [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Непрозрачност на командния ред
.txtexp-no-text-selected = TXTEXP: няма избран текст. .txtexp-no-text-selected = TXTEXP: няма избран текст.
.angle-override-shown = Замяна на ъгъла: __ocs_fmt_0__ .angle-override-shown = Замяна на ъгъла: __ocs_fmt_0__
.plot-preview-task = Преглед на печата .plot-preview-task = Преглед на печата
+1
View File
@@ -281,6 +281,7 @@ command-copy =
.mode = COPY Zadejte režim kopírování [Single/Multiple] <Multiple>: .mode = COPY Zadejte režim kopírování [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Neprůhlednost příkazového řádku
.txtexp-no-text-selected = TXTEXP: není vybrán žádný text. .txtexp-no-text-selected = TXTEXP: není vybrán žádný text.
.angle-override-shown = Přepsání úhlu: __ocs_fmt_0__ .angle-override-shown = Přepsání úhlu: __ocs_fmt_0__
.plot-preview-task = Náhled tisku .plot-preview-task = Náhled tisku
+1
View File
@@ -282,6 +282,7 @@ command-copy =
.mode = COPY Kopiermodus eingeben [Single/Multiple] <Multiple>: .mode = COPY Kopiermodus eingeben [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Deckkraft der Befehlszeile
.txtexp-no-text-selected = TXTEXP: kein Text gewählt. .txtexp-no-text-selected = TXTEXP: kein Text gewählt.
.angle-override-shown = Winkelvorgabe: __ocs_fmt_0__ .angle-override-shown = Winkelvorgabe: __ocs_fmt_0__
.plot-preview-task = Plotvorschau .plot-preview-task = Plotvorschau
+1
View File
@@ -281,6 +281,7 @@ command-copy =
.mode = COPY Επιλέξτε λειτουργία αντιγραφής [Single/Multiple] <Multiple>: .mode = COPY Επιλέξτε λειτουργία αντιγραφής [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Αδιαφάνεια γραμμής εντολών
.txtexp-no-text-selected = TXTEXP: δεν επιλέχθηκε κείμενο. .txtexp-no-text-selected = TXTEXP: δεν επιλέχθηκε κείμενο.
.angle-override-shown = Παράκαμψη γωνίας: __ocs_fmt_0__ .angle-override-shown = Παράκαμψη γωνίας: __ocs_fmt_0__
.plot-preview-task = Προεπισκόπηση εκτύπωσης .plot-preview-task = Προεπισκόπηση εκτύπωσης
+1
View File
@@ -281,6 +281,7 @@ command-copy =
.mode = COPY Enter a copy mode option [Single/Multiple] <Multiple>: .mode = COPY Enter a copy mode option [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Command line opacity
.txtexp-no-text-selected = TXTEXP: no text selected. .txtexp-no-text-selected = TXTEXP: no text selected.
.angle-override-shown = Angle Override: __ocs_fmt_0__ .angle-override-shown = Angle Override: __ocs_fmt_0__
.browser-cannot-open-typed-path = The browser cannot open a typed path; pick the file instead. .browser-cannot-open-typed-path = The browser cannot open a typed path; pick the file instead.
+1
View File
@@ -282,6 +282,7 @@ command-copy =
.mode = COPY Indique modo de copia [Single/Multiple] <Multiple>: .mode = COPY Indique modo de copia [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Opacidad de la línea de comando
.txtexp-no-text-selected = TXTEXP: no se ha seleccionado ningún texto. .txtexp-no-text-selected = TXTEXP: no se ha seleccionado ningún texto.
.angle-override-shown = Modificación de ángulo: __ocs_fmt_0__ .angle-override-shown = Modificación de ángulo: __ocs_fmt_0__
.plot-preview-task = Vista previa de trazado .plot-preview-task = Vista previa de trazado
+1
View File
@@ -281,6 +281,7 @@ command-copy =
.mode = COPY Valitse kopiointitila [Single/Multiple] <Multiple>: .mode = COPY Valitse kopiointitila [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Komentorivin peittävyys
.txtexp-no-text-selected = TXTEXP: tekstiä ei ole valittu. .txtexp-no-text-selected = TXTEXP: tekstiä ei ole valittu.
.angle-override-shown = Kulman ohitus: __ocs_fmt_0__ .angle-override-shown = Kulman ohitus: __ocs_fmt_0__
.plot-preview-task = Tulostuksen esikatselu .plot-preview-task = Tulostuksen esikatselu
+1
View File
@@ -282,6 +282,7 @@ command-copy =
.mode = COPY Entrez le mode de copie [Single/Multiple] <Multiple> : .mode = COPY Entrez le mode de copie [Single/Multiple] <Multiple> :
common = common =
.command-line-opacity = Opacité de la ligne de commande
.txtexp-no-text-selected = TXTEXP : aucun texte sélectionné. .txtexp-no-text-selected = TXTEXP : aucun texte sélectionné.
.angle-override-shown = Remplacement d’angle : __ocs_fmt_0__ .angle-override-shown = Remplacement d’angle : __ocs_fmt_0__
.plot-preview-task = Aperçu du tracé .plot-preview-task = Aperçu du tracé
+1
View File
@@ -270,6 +270,7 @@ command-copy =
.mode = COPY कॉपी मोड विकल्प दर्ज करें [Single/Multiple] <Multiple>: .mode = COPY कॉपी मोड विकल्प दर्ज करें [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = कमांड लाइन अपारदर्शिता
.txtexp-no-text-selected = TXTEXP: कोई टेक्स्ट चयनित नहीं। .txtexp-no-text-selected = TXTEXP: कोई टेक्स्ट चयनित नहीं।
.angle-override-shown = कोण ओवरराइड: __ocs_fmt_0__ .angle-override-shown = कोण ओवरराइड: __ocs_fmt_0__
.plot-preview-task = प्लॉट पूर्वावलोकन .plot-preview-task = प्लॉट पूर्वावलोकन
+1
View File
@@ -280,6 +280,7 @@ command-copy =
.mode = COPY Adja meg a másolási módot [Single/Multiple] <Multiple>: .mode = COPY Adja meg a másolási módot [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Parancssor átlátszatlansága
.txtexp-no-text-selected = TXTEXP: nincs kijelölt szöveg. .txtexp-no-text-selected = TXTEXP: nincs kijelölt szöveg.
.angle-override-shown = Szög felülbírálása: __ocs_fmt_0__ .angle-override-shown = Szög felülbírálása: __ocs_fmt_0__
.parametric-coincident = Egybeeső .parametric-coincident = Egybeeső
+1
View File
@@ -281,6 +281,7 @@ command-copy =
.mode = COPY Specificare modalità di copia [Single/Multiple] <Multiple>: .mode = COPY Specificare modalità di copia [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Opacità della riga di comando
.txtexp-no-text-selected = TXTEXP: nessun testo selezionato. .txtexp-no-text-selected = TXTEXP: nessun testo selezionato.
.angle-override-shown = Sostituzione angolo: __ocs_fmt_0__ .angle-override-shown = Sostituzione angolo: __ocs_fmt_0__
.plot-preview-task = Anteprima di stampa .plot-preview-task = Anteprima di stampa
+1
View File
@@ -272,6 +272,7 @@ command-copy =
.mode = COPY コピーモードを入力 [Single/Multiple] <Multiple>: .mode = COPY コピーモードを入力 [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = コマンドラインの不透明度
.txtexp-no-text-selected = TXTEXP: 文字が選択されていません。 .txtexp-no-text-selected = TXTEXP: 文字が選択されていません。
.angle-override-shown = 角度の優先: __ocs_fmt_0__ .angle-override-shown = 角度の優先: __ocs_fmt_0__
.plot-preview-task = 印刷プレビュー .plot-preview-task = 印刷プレビュー
+1
View File
@@ -281,6 +281,7 @@ command-copy =
.mode = COPY 복사 모드 옵션 입력 [Single/Multiple] <Multiple>: .mode = COPY 복사 모드 옵션 입력 [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = 명령행 불투명도
.txtexp-no-text-selected = TXTEXP: 선택된 문자가 없습니다. .txtexp-no-text-selected = TXTEXP: 선택된 문자가 없습니다.
.angle-override-shown = 각도 재지정: __ocs_fmt_0__ .angle-override-shown = 각도 재지정: __ocs_fmt_0__
.plot-preview-task = 플롯 미리 보기 .plot-preview-task = 플롯 미리 보기
+1
View File
@@ -281,6 +281,7 @@ command-copy =
.mode = COPY ປ້ອນຕົວເລືອກໂໝດການຄັດລອກ [Single/Multiple] <Multiple>: .mode = COPY ປ້ອນຕົວເລືອກໂໝດການຄັດລອກ [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = ຄວາມທຶບຂອງແຖວຄຳສັ່ງ
.txtexp-no-text-selected = TXTEXP: ບໍ່ໄດ້ເລືອກຂໍ້ຄວາມ. .txtexp-no-text-selected = TXTEXP: ບໍ່ໄດ້ເລືອກຂໍ້ຄວາມ.
.angle-override-shown = ກຳນົດມຸມແທນ: __ocs_fmt_0__ .angle-override-shown = ກຳນົດມຸມແທນ: __ocs_fmt_0__
.remote-image-url-could-not-be-fetched-the-request-timed-out = ບໍ່ສາມາດດຶງຮູບພາບທາງໄກ "__ocs_fmt_0__" ໄດ້: ການຮ້ອງຂໍໝົດເວລາ. .remote-image-url-could-not-be-fetched-the-request-timed-out = ບໍ່ສາມາດດຶງຮູບພາບທາງໄກ "__ocs_fmt_0__" ໄດ້: ການຮ້ອງຂໍໝົດເວລາ.
+1
View File
@@ -282,6 +282,7 @@ command-copy =
.mode = COPY Geef kopieermodus op [Single/Multiple] <Multiple>: .mode = COPY Geef kopieermodus op [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Dekking van de opdrachtregel
.txtexp-no-text-selected = TXTEXP: geen tekst geselecteerd. .txtexp-no-text-selected = TXTEXP: geen tekst geselecteerd.
.angle-override-shown = Hoekoverschrijving: __ocs_fmt_0__ .angle-override-shown = Hoekoverschrijving: __ocs_fmt_0__
.plot-preview-task = Plotvoorbeeld .plot-preview-task = Plotvoorbeeld
+1
View File
@@ -281,6 +281,7 @@ command-copy =
.mode = COPY Podaj tryb kopiowania [Single/Multiple] <Multiple>: .mode = COPY Podaj tryb kopiowania [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Krycie wiersza poleceń
.txtexp-no-text-selected = TXTEXP: nie wybrano tekstu. .txtexp-no-text-selected = TXTEXP: nie wybrano tekstu.
.angle-override-shown = Zastąpienie kąta: __ocs_fmt_0__ .angle-override-shown = Zastąpienie kąta: __ocs_fmt_0__
.plot-preview-task = Podgląd wydruku .plot-preview-task = Podgląd wydruku
+1
View File
@@ -282,6 +282,7 @@ command-copy =
.mode = COPY Informe o modo de cópia [Single/Multiple] <Multiple>: .mode = COPY Informe o modo de cópia [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Opacidade da linha de comando
.txtexp-no-text-selected = TXTEXP: nenhum texto selecionado. .txtexp-no-text-selected = TXTEXP: nenhum texto selecionado.
.angle-override-shown = Substituição de ângulo: __ocs_fmt_0__ .angle-override-shown = Substituição de ângulo: __ocs_fmt_0__
.plot-preview-task = Visualização da plotagem .plot-preview-task = Visualização da plotagem
+1
View File
@@ -285,6 +285,7 @@ command-copy =
.mode = COPY Задайте режим копирования [Single/Multiple] <Multiple>: .mode = COPY Задайте режим копирования [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Непрозрачность командной строки
.txtexp-no-text-selected = TXTEXP: текст не выбран. .txtexp-no-text-selected = TXTEXP: текст не выбран.
.angle-override-shown = Переопределение угла: __ocs_fmt_0__ .angle-override-shown = Переопределение угла: __ocs_fmt_0__
.plot-preview-task = Предварительный просмотр печати .plot-preview-task = Предварительный просмотр печати
+1
View File
@@ -267,6 +267,7 @@ command-copy =
.mode = COPY Kopyalama modu seçin [Single/Multiple] <Multiple>: .mode = COPY Kopyalama modu seçin [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = Komut satırı opaklığı
.txtexp-no-text-selected = TXTEXP: metin seçilmedi. .txtexp-no-text-selected = TXTEXP: metin seçilmedi.
.angle-override-shown = Açı geçersiz kılma: __ocs_fmt_0__ .angle-override-shown = Açı geçersiz kılma: __ocs_fmt_0__
.plot-preview-task = Çizim önizleme .plot-preview-task = Çizim önizleme
+1
View File
@@ -269,6 +269,7 @@ command-copy =
.mode = COPY 输入复制模式选项 [Single/Multiple] <Multiple>: .mode = COPY 输入复制模式选项 [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = 命令行不透明度
.txtexp-no-text-selected = TXTEXP: 未选择文字。 .txtexp-no-text-selected = TXTEXP: 未选择文字。
.angle-override-shown = 角度替代:__ocs_fmt_0__ .angle-override-shown = 角度替代:__ocs_fmt_0__
.plot-preview-task = 打印预览 .plot-preview-task = 打印预览
+1
View File
@@ -281,6 +281,7 @@ command-copy =
.mode = COPY 輸入複製模式選項 [Single/Multiple] <Multiple>: .mode = COPY 輸入複製模式選項 [Single/Multiple] <Multiple>:
common = common =
.command-line-opacity = 命令列不透明度
.txtexp-no-text-selected = TXTEXP: 未選擇文字。 .txtexp-no-text-selected = TXTEXP: 未選擇文字。
.angle-override-shown = 角度取代:__ocs_fmt_0__ .angle-override-shown = 角度取代:__ocs_fmt_0__
.plot-preview-task = 出圖預覽 .plot-preview-task = 出圖預覽
+1
View File
@@ -754,6 +754,7 @@ inventory::submit!(crate::command::CommandRegistration {
"SKTOLERANCE", "SKTOLERANCE",
"CLIPROMPTLINES", "CLIPROMPTLINES",
"COMMANDLINEFADETIME", "COMMANDLINEFADETIME",
"COMMANDLINEOPACITY",
"COLORTHEME", "COLORTHEME",
"SELECTIONAREA", "SELECTIONAREA",
"SELECTIONAREAOPACITY", "SELECTIONAREAOPACITY",
+18
View File
@@ -1149,6 +1149,7 @@ impl OpenCADStudio {
| "CURSORSIZE" | "CURSORSIZE"
| "PICKBOX" | "PICKBOX"
| "HPASSOC" | "HPASSOC"
| "COMMANDLINEOPACITY"
| "CURSORTYPE" | "CURSORTYPE"
| "SNAPANG" | "SNAPANG"
| "TEXTFILL" | "TEXTFILL"
@@ -2537,6 +2538,22 @@ impl OpenCADStudio {
false, false,
)), )),
}, },
"COMMANDLINEOPACITY" => match &value {
Some(v) => match v.parse::<u8>() {
Ok(n) if (20..=100).contains(&n) => {
self.command_line.set_opacity_percent(n);
Ok((format!("COMMANDLINEOPACITY = {n}"), true))
}
_ => Err("SETVAR: integer from 20 to 100 required.".into()),
},
None => Ok((
format!(
"COMMANDLINEOPACITY = {}",
self.command_line.opacity_percent()
),
false,
)),
},
"COMMANDLINEFADETIME" => match &value { "COMMANDLINEFADETIME" => match &value {
Some(v) => match v.parse::<i32>() { Some(v) => match v.parse::<i32>() {
Ok(n) if (0..=60000).contains(&n) => { Ok(n) if (0..=60000).contains(&n) => {
@@ -3147,6 +3164,7 @@ impl OpenCADStudio {
| "CURSORSIZE" | "CURSORSIZE"
| "PICKBOX" | "PICKBOX"
| "HPASSOC" | "HPASSOC"
| "COMMANDLINEOPACITY"
| "CURSORTYPE" | "CURSORTYPE"
| "SNAPANG" | "SNAPANG"
| "CLIPROMPTLINES" | "CLIPROMPTLINES"
+2
View File
@@ -2607,6 +2607,8 @@ pub enum Message {
ClipromptLinesChanged(i32), ClipromptLinesChanged(i32),
/// Change how long command-line history lines stay visible (COMMANDLINEFADETIME). /// Change how long command-line history lines stay visible (COMMANDLINEFADETIME).
CommandLineFadeChanged(i32), CommandLineFadeChanged(i32),
/// Change the command line's panel opacity (COMMANDLINEOPACITY).
CommandLineOpacityChanged(u8),
/// Toggle reversing the mouse-wheel zoom direction (ZOOMWHEEL). /// Toggle reversing the mouse-wheel zoom direction (ZOOMWHEEL).
ZoomWheelReversedChanged(bool), ZoomWheelReversedChanged(bool),
TouchpadPanChanged(bool), TouchpadPanChanged(bool),
+3
View File
@@ -587,6 +587,8 @@ pub struct UserSettings {
deserialize_with = "deserialize_commandline_fade_ms" deserialize_with = "deserialize_commandline_fade_ms"
)] )]
pub commandline_fade_ms: i32, pub commandline_fade_ms: i32,
/// COMMANDLINEOPACITY: command-line panel opacity in percent (20–100).
pub command_line_opacity: u8,
/// SNAPUNIT X/Y spacing used by grid snap. 10 matches the Drafting /// SNAPUNIT X/Y spacing used by grid snap. 10 matches the Drafting
/// Settings dialog defaults; older configs without these keys fall /// Settings dialog defaults; older configs without these keys fall
/// back via `default_snap_spacing`. /// back via `default_snap_spacing`.
@@ -896,6 +898,7 @@ impl Default for UserSettings {
language: crate::i18n::Language::default(), language: crate::i18n::Language::default(),
cliprompt_lines: 3, cliprompt_lines: 3,
commandline_fade_ms: 3000, commandline_fade_ms: 3000,
command_line_opacity: 100,
snap_spacing_x: 10.0, snap_spacing_x: 10.0,
snap_spacing_y: 10.0, snap_spacing_y: 10.0,
grid_spacing_x: 10.0, grid_spacing_x: 10.0,
+2
View File
@@ -847,6 +847,7 @@ impl OpenCADStudio {
quick_properties: self.quick_properties, quick_properties: self.quick_properties,
language: self.language, language: self.language,
cliprompt_lines: crate::app::settings::clamp_clipromptlines(self.cliprompt_lines), cliprompt_lines: crate::app::settings::clamp_clipromptlines(self.cliprompt_lines),
command_line_opacity: self.command_line.opacity_percent(),
commandline_fade_ms: crate::app::settings::clamp_commandline_fade_ms( commandline_fade_ms: crate::app::settings::clamp_commandline_fade_ms(
self.commandline_fade_ms, self.commandline_fade_ms,
), ),
@@ -999,6 +1000,7 @@ impl OpenCADStudio {
self.cliprompt_lines = crate::app::settings::clamp_clipromptlines(s.cliprompt_lines); self.cliprompt_lines = crate::app::settings::clamp_clipromptlines(s.cliprompt_lines);
self.command_line self.command_line
.set_cliprompt_lines(self.cliprompt_lines.clamp(0, 50) as u8); .set_cliprompt_lines(self.cliprompt_lines.clamp(0, 50) as u8);
self.command_line.set_opacity_percent(s.command_line_opacity);
self.commandline_fade_ms = self.commandline_fade_ms =
crate::app::settings::clamp_commandline_fade_ms(s.commandline_fade_ms); crate::app::settings::clamp_commandline_fade_ms(s.commandline_fade_ms);
self.command_line self.command_line
+6
View File
@@ -9057,6 +9057,12 @@ impl OpenCADStudio {
Task::none() Task::none()
} }
Message::CommandLineOpacityChanged(percent) => {
self.command_line.set_opacity_percent(percent);
self.persist_settings_if_changed();
Task::none()
}
Message::CommandLineFadeChanged(ms) => { Message::CommandLineFadeChanged(ms) => {
let ms = crate::app::settings::clamp_commandline_fade_ms(ms); let ms = crate::app::settings::clamp_commandline_fade_ms(ms);
self.commandline_fade_ms = ms; self.commandline_fade_ms = ms;
+1
View File
@@ -299,6 +299,7 @@ impl OpenCADStudio {
textfill: crate::scene::text::sdf_atlas::textfill(), textfill: crate::scene::text::sdf_atlas::textfill(),
cliprompt_lines: self.cliprompt_lines, cliprompt_lines: self.cliprompt_lines,
commandline_fade_ms: self.commandline_fade_ms, commandline_fade_ms: self.commandline_fade_ms,
command_line_opacity: self.command_line.opacity_percent(),
zoom_wheel_reversed: self.zoom_wheel_reversed, zoom_wheel_reversed: self.zoom_wheel_reversed,
touchpad_pan: self.touchpad_pan, touchpad_pan: self.touchpad_pan,
ui_scale_percent: self.ui_scale_percent, ui_scale_percent: self.ui_scale_percent,
+1
View File
@@ -3697,6 +3697,7 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static
"Width factor" => Some(("common", "width-factor-sentence-case")), "Width factor" => Some(("common", "width-factor-sentence-case")),
"Width: %{value}" => Some(("ui", "width-value")), "Width: %{value}" => Some(("ui", "width-value")),
"Window" => Some(("common", "window")), "Window" => Some(("common", "window")),
"Command line opacity" => Some(("common", "command-line-opacity")),
"TXTEXP: no text selected." => Some(("common", "txtexp-no-text-selected")), "TXTEXP: no text selected." => Some(("common", "txtexp-no-text-selected")),
"Windows desktop" => Some(("styles", "windows-desktop")), "Windows desktop" => Some(("styles", "windows-desktop")),
"Wipeout" => Some(("common", "wipeout")), "Wipeout" => Some(("common", "wipeout")),
+24 -5
View File
@@ -191,6 +191,9 @@ pub struct CommandLine {
/// in milliseconds (0–60000, default 3000). 0 means history never fades; /// in milliseconds (0–60000, default 3000). 0 means history never fades;
/// the pinned step prompt still shows. /// the pinned step prompt still shows.
fade_ms: u32, fade_ms: u32,
/// COMMANDLINEOPACITY: how opaque the command line's panels are, in
/// percent (20–100, default 100), so the drawing shows through.
opacity_percent: u8,
} }
impl Default for CommandLine { impl Default for CommandLine {
@@ -217,6 +220,7 @@ impl Default for CommandLine {
step_options: Vec::new(), step_options: Vec::new(),
cliprompt_lines: 3, cliprompt_lines: 3,
fade_ms: DEFAULT_COMMANDLINE_FADE_MS, fade_ms: DEFAULT_COMMANDLINE_FADE_MS,
opacity_percent: 100,
} }
} }
} }
@@ -509,6 +513,15 @@ impl CommandLine {
self.fade_ms self.fade_ms
} }
/// COMMANDLINEOPACITY mirror (percent, 20–100).
pub fn set_opacity_percent(&mut self, percent: u8) {
self.opacity_percent = percent.clamp(20, 100);
}
pub fn opacity_percent(&self) -> u8 {
self.opacity_percent
}
fn fade_secs(&self) -> f32 { fn fade_secs(&self) -> f32 {
self.fade_ms as f32 / 1000.0 self.fade_ms as f32 / 1000.0
} }
@@ -1127,12 +1140,15 @@ impl CommandLine {
// The transient recent lines and the full archive are two views of the // The transient recent lines and the full archive are two views of the
// same history. Showing both while the archive is open creates a fake // same history. Showing both while the archive is open creates a fake
// second history region and visually disconnects the input row (#555). // second history region and visually disconnects the input row (#555).
let opacity = f32::from(self.opacity_percent) / 100.0;
let recent_history: Element<'a, Message> = if self.history_open || !has_recent_history { let recent_history: Element<'a, Message> = if self.history_open || !has_recent_history {
container(column![]).height(0).into() container(column![]).height(0).into()
} else { } else {
container(history_rows) container(history_rows)
.style(|theme: &Theme| container::Style { .style(move |theme: &Theme| container::Style {
background: Some(Background::Color(theme.palette().background.base.color)), background: Some(Background::Color(
theme.palette().background.base.color.scale_alpha(opacity),
)),
..Default::default() ..Default::default()
}) })
.width(Length::Fill) .width(Length::Fill)
@@ -1153,10 +1169,11 @@ impl CommandLine {
recent_history, recent_history,
history_divider, history_divider,
container(input_row) container(input_row)
.style(|theme: &Theme| { .style(move |theme: &Theme| {
let palette = theme.palette(); let palette = theme.palette();
let color = palette.background.weakest.color.scale_alpha(opacity);
container::Style { container::Style {
background: Some(Background::Color(palette.background.weakest.color)), background: Some(Background::Color(color)),
..Default::default() ..Default::default()
} }
}) })
@@ -1170,7 +1187,9 @@ impl CommandLine {
.style(move |theme: &Theme| { .style(move |theme: &Theme| {
let palette = theme.palette(); let palette = theme.palette();
container::Style { container::Style {
background: Some(Background::Color(palette.background.base.color)), background: Some(Background::Color(
palette.background.base.color.scale_alpha(opacity),
)),
border: Border { border: Border {
color: palette.background.neutral.color, color: palette.background.neutral.color,
width: if history_open { 1.0 } else { 0.0 }, width: if history_open { 1.0 } else { 0.0 },
+18
View File
@@ -53,6 +53,8 @@ pub struct AppPrefs {
pub cliprompt_lines: i32, pub cliprompt_lines: i32,
/// COMMANDLINEFADETIME: how long overlay history lines stay visible, in ms. /// COMMANDLINEFADETIME: how long overlay history lines stay visible, in ms.
pub commandline_fade_ms: i32, pub commandline_fade_ms: i32,
/// COMMANDLINEOPACITY: command-line panel opacity in percent.
pub command_line_opacity: u8,
/// ZOOMWHEEL: reverse the mouse-wheel zoom direction. /// ZOOMWHEEL: reverse the mouse-wheel zoom direction.
pub zoom_wheel_reversed: bool, pub zoom_wheel_reversed: bool,
/// Scroll pans and Ctrl+scroll zooms (touchpads). /// Scroll pans and Ctrl+scroll zooms (touchpads).
@@ -974,6 +976,22 @@ pub fn view_window<'a>(
)) ))
.size(11) .size(11)
.width(sizing.width), .width(sizing.width),
)
.push(Space::new().height(12))
.push(
row![
text(crate::t!("Command line opacity")).size(12).width(140),
slider(
20..=100,
prefs.command_line_opacity.clamp(20, 100),
Message::CommandLineOpacityChanged,
)
.step(5u8)
.width(Fill),
text(format!("{}%", prefs.command_line_opacity)).size(11).width(44),
]
.spacing(10)
.align_y(iced::Center),
); );
let display_element = display.spacing(0).width(sizing.width); let display_element = display.spacing(0).width(sizing.width);