如何使Gtk3中的焦點矩形更加突出?

如何使Gtk3中的焦點矩形更加突出?

我幾乎一直使用鍵盤進行導航;我經常忘記打開電池供電的滑鼠,我只在 15 或 30 分鐘後才注意到:)但是使用 Gnome/Gtk 3 變得更困難,因為使用預設主題(我認為 Adwaita),焦點指示器矩形是如此瘦得幾乎看不見了,而且我的眼睛也在衰退。所以這幾乎是一次糟糕的拍攝:我按了幾次 Tab 鍵,然後按空白鍵或箭頭鍵,然後發生了一些意想不到的事情,因為焦點不在我想像的地方。

如何使焦點指示器更明顯?

答案1

Gtk3 中的焦點指示器與 HTML 類似,定義為CSS大綱風格

[…]:focus(visible) {
  // We use the outline properties to signal the focus properties
  // to the adwaita engine: using real CSS properties is faster,
  // and we don't use any outlines for now.

  outline-color: gtkalpha(currentColor, 0.3);
  outline-style: dashed;
  outline-offset: -3px;
  outline-width: 1px;
  -gtk-outline-radius: 2px;
}

您可以透過主題、自訂樣式表或透過檢查器臨時(用於實驗)覆蓋它CtrlShiftI。所以如果你想讓它看起來像熱狗攤

*:focus {
    color: blue;
    background-color: yellow;
    outline-color: red;
    outline-style: solid;
    outline-width: 2px;
}

自訂樣式表儲存在~/.config/gtk-3.0/gtk.css任何主題中並適用。

相關內容