색깔을 바꾸고 싶어요주황색다른 것에게닫기 버튼~에야루 테마.
편집을 통해 어떻게 할 수 있나요?CSS파일?
답변1
해결 방법
OS: Ubuntu 19.10
GTK-테마: Yaru
아이콘-테마: Yaru
/usr/share/themes/Yaru/gtk-3.20/
아래 명령을 사용하여 gtk.css 파일을 엽니다.
sudo -H gedit /usr/share/themes/Yaru/gtk-3.20/gtk.css
기존 텍스트 아래에 아래 코드를 붙여넣고 원하는 대로 색상을 변경하세요.
headerbar button.titlebutton:not(.appmenu).close,
.titlebar button.titlebutton:not(.appmenu).close,
headerbar.selection-mode button.titlebutton:not(.appmenu).close, button.titlebutton:not(.appmenu).close {
color: #ffffff;
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(#E95420), to(transparent)); }
headerbar button.titlebutton:not(.appmenu).close:hover,
.titlebar button.titlebutton:not(.appmenu).close:hover,
headerbar.selection-mode button.titlebutton:not(.appmenu).close:hover, button.titlebutton:not(.appmenu).close:hover {
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(#E95420), to(transparent));
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(#eb6637), to(transparent)); }
headerbar button.titlebutton:not(.appmenu).close:active,
.titlebar button.titlebutton:not(.appmenu).close:active,
headerbar.selection-mode button.titlebutton:not(.appmenu).close:active, button.titlebutton:not(.appmenu).close:active {
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(#E95420), to(transparent));
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(#da4816), to(transparent)); }
headerbar button.titlebutton:not(.appmenu).close:backdrop,
.titlebar button.titlebutton:not(.appmenu).close:backdrop,
headerbar.selection-mode button.titlebutton:not(.appmenu).close:backdrop, button.titlebutton:not(.appmenu).close:backdrop {
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(#636363), to(transparent)); }
headerbar button.titlebutton:not(.appmenu).close:backdrop:hover,
.titlebar button.titlebutton:not(.appmenu).close:backdrop:hover,
headerbar.selection-mode button.titlebutton:not(.appmenu).close:backdrop:hover, button.titlebutton:not(.appmenu).close:backdrop:hover {
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(#707070), to(transparent)); }
다음은 파일의 사용자 정의된 파일 내용입니다./usr/share/themes/Yaru/gtk-3.20/gtk.css
@import url("resource:///com/ubuntu/themes/Yaru/3.20/gtk.css");
headerbar button.titlebutton:not(.appmenu).close,
.titlebar button.titlebutton:not(.appmenu).close,
headerbar.selection-mode button.titlebutton:not(.appmenu).close, button.titlebutton:not(.appmenu).close {
color: red;
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(green), to(transparent)); }
headerbar button.titlebutton:not(.appmenu).close:hover,
.titlebar button.titlebutton:not(.appmenu).close:hover,
headerbar.selection-mode button.titlebutton:not(.appmenu).close:hover, button.titlebutton:not(.appmenu).close:hover {
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(gold), to(transparent));
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(cyan, to(transparent)); }
headerbar button.titlebutton:not(.appmenu).close:active,
.titlebar button.titlebutton:not(.appmenu).close:active,
headerbar.selection-mode button.titlebutton:not(.appmenu).close:active, button.titlebutton:not(.appmenu).close:active {
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(magenta), to(transparent));
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(orange), to(transparent)); }
headerbar button.titlebutton:not(.appmenu).close:backdrop,
.titlebar button.titlebutton:not(.appmenu).close:backdrop,
headerbar.selection-mode button.titlebutton:not(.appmenu).close:backdrop, button.titlebutton:not(.appmenu).close:backdrop {
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(blue), to(transparent)); }
headerbar button.titlebutton:not(.appmenu).close:backdrop:hover,
.titlebar button.titlebutton:not(.appmenu).close:backdrop:hover,
headerbar.selection-mode button.titlebutton:not(.appmenu).close:backdrop:hover, button.titlebutton:not(.appmenu).close:backdrop:hover {
background-image: -gtk-gradient(radial, center center, 0, center center, 0.35714, to(yellow), to(transparent)); }
선택적으로 아이콘을 변경할 수 있습니다. 아래 사진은 설명이 필요합니다..
답변2
에 스타일을 작성하여 닫기 버튼의 스타일을 변경할 수 있습니다 ~/.config/gtk-3.0/gtk.css
.
button.titlebutton.close:backdrop {
background-color: transparent;
}
button.titlebutton.close {
background-color: @theme_selected_bg_color;
}
참고자료: