焦点时更改 GtkButton 的边框颜色

问题描述 投票:0回答:1

我想设置

GtkButton
具有焦点时的边框颜色。我尝试了以下CSS,但它不起作用。

.toggle-button:focus {
  outline-width: 2px;
  border-color: #000000;
}

我还需要设置其他属性吗?我怎样才能实现这个目标?

gtk gnome
1个回答
0
投票

如果您不了解脚本的相关部分,那么回答这个问题并不容易。这对我有用。

/* applies to button1 */
.button1{
  border-radius: 50px;
  border: 2px solid green;
  color: red;
}
/* button1 mouse over it */
.button1:hover {
   background: grey;
}
/*button2 - basic setting*/
.button2 {
  color: maroon;
  border: 4px dotted red;
  background: grey;
}
/* button2 clicked */
.button2:active {
     background: red;
} 
/* button2 has fokus */
.button2:focus {
    color: white;
}

/*button3 - basic setting */
.button3 {
    border: 10px dashed blue;
    color: black;
}

/*button4 -basic setting */
.button4 {
    border-radius: 200px;
}

如果有需要,我也可以提供我对应的脚本。

© www.soinside.com 2019 - 2024. All rights reserved.