[Exchange and share] v23 gtk标题栏宽度修改位置
Tofloor
poster avatar
神末shenmo
Moderator
Spark-App
2023-08-08 22:58
Author

Dtk应用标题栏

sudo apt install dde-dconfig-editor

图片.png


Gtk应用标题栏

~/.local/share/deepin/themes/deepin/light/decoration.json

~/.local/share/deepin/themes/deepin/dark/decoration.json

可手动指定标题栏宽度

{
  "version": 1.0,
  "name": "行云",
  "1001": {
    "desc": "普通窗口",
    "titlebar": {
      "height": 40,
      "area": 1,
      "mouseInputAreaMargins": "5,5,5,5",
      "bgcolor": "white",
      "font-family": "SourceHanSansSC",
      "font-size": 14,
      "text-align": "center",
      "text-color": {
        "active": "#303030",
        "inactive": "#969696"
      },
      "button-group": {
        "menu": {
          "pos": "12,3",
          "icon": {
            "normal": ":/deepin/themes/deepin/light/icons/menu_normal.svg",
            "hover": ":/deepin/themes/deepin/light/icons/menu_hover.svg",
            "press": ":/deepin/themes/deepin/light/icons/menu_press.svg",
            "disabled": ":/deepin/themes/deepin/light/icons/menu_disabled.svg"
          },
          "width": 37,
          "height": 37,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "minimize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/light/icons/minimize_normal.svg",
            "hover": ":/deepin/themes/deepin/light/icons/minimize_hover.svg",
            "press": ":/deepin/themes/deepin/light/icons/minimize_press.svg",
            "disabled": ":/deepin/themes/deepin/light/icons/minimize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "maximize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/light/icons/maximize_normal.svg",
            "hover": ":/deepin/themes/deepin/light/icons/maximize_hover.svg",
            "press": ":/deepin/themes/deepin/light/icons/maximize_press.svg",
            "disabled": ":/deepin/themes/deepin/light/icons/maximize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "unmaximize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/light/icons/unmaximize_normal.svg",
            "hover": ":/deepin/themes/deepin/light/icons/unmaximize_hover.svg",
            "press": ":/deepin/themes/deepin/light/icons/unmaximize_press.svg",
            "disabled": ":/deepin/themes/deepin/light/icons/unmaximize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "close": {
          "icon": {
            "normal": ":/deepin/themes/deepin/light/icons/close_normal.svg",
            "hover": ":/deepin/themes/deepin/light/icons/close_hover.svg",
            "press": ":/deepin/themes/deepin/light/icons/close_press.svg",
            "disabled": ":/deepin/themes/deepin/light/icons/close_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        }
      }
    },
    "border": {
      "width": 1,
      "color": "#20000000"
    },
    "rounded-corner-radius": "18,18",
    "blur": 10,
    "opcaity": 1,
    "shadow": {
      "shadowRadius": 40,
      "shadowOffset": "0,30",
      "shadowColor": {
        "active": "#80000000",
        "inactive": "#40000000"
      }
    }
  },
  "1002": {
    "desc": "对话框",
    "titlebar": {
      "height": 40,
      "area": 1,
      "bgcolor": "white",
      "font-family": "SourceHanSansSC",
      "font-size": 14,
      "text-align": "center",
      "text-color": "#000000",
      "button-group": {
        "menu": {
          "pos": "12,3",
          "icon": {
            "normal": ":/deepin/themes/deepin/light/icons/menu_normal.svg",
            "hover": ":/deepin/themes/deepin/light/icons/menu_hover.svg",
            "press": ":/deepin/themes/deepin/light/icons/menu_press.svg",
            "disabled": ":/deepin/themes/deepin/light/icons/menu_disabled.svg"
          },
          "width": 37,
          "height": 37,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "minimize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/light/icons/minimize_normal.svg",
            "hover": ":/deepin/themes/deepin/light/icons/minimize_hover.svg",
            "press": ":/deepin/themes/deepin/light/icons/minimize_press.svg",
            "disabled": ":/deepin/themes/deepin/light/icons/minimize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "maximize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/light/icons/maximize_normal.svg",
            "hover": ":/deepin/themes/deepin/light/icons/maximize_hover.svg",
            "press": ":/deepin/themes/deepin/light/icons/maximize_press.svg",
            "disabled": ":/deepin/themes/deepin/light/icons/maximize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "unmaximize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/light/icons/unmaximize_normal.svg",
            "hover": ":/deepin/themes/deepin/light/icons/unmaximize_hover.svg",
            "press": ":/deepin/themes/deepin/light/icons/unmaximize_press.svg",
            "disabled": ":/deepin/themes/deepin/light/icons/unmaximize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "close": {
          "icon": {
            "normal": ":/deepin/themes/deepin/light/icons/close_normal.svg",
            "hover": ":/deepin/themes/deepin/light/icons/close_hover.svg",
            "press": ":/deepin/themes/deepin/light/icons/close_press.svg",
            "disabled": ":/deepin/themes/deepin/light/icons/close_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        }
      }
    },
    "border": {
      "width": 1,
      "color": "#0F000000"
    },
    "rounded-corner-radius": "18,18",
    "blur": 10,
    "opcaity": 1,
    "shadow": {
      "shadowRadius": 40,
      "shadowOffset": "0,20",
      "shadowColor": "#33000000"
    }
  },
  "1003": {
    "desc": "dock栏",
    "border": {
      "width": 1,
      "color": "#20FFFFFF"
    },
    "rounded-corner-radius": "18,18",
    "blur": 10,
    "opcaity": 0,
    "shadow": {
      "shadowRadius": 14,
      "shadowOffset": "0,2",
      "shadowColor": "20000000"
    }
  },
  "1004": {
    "desc": "右键菜单",
    "border": {
      "width": 1,
      "color": "#20FFFFFF"
    },
    "rounded-corner-radius": "18,18",
    "blur": 30,
    "opcaity": 1,
    "shadow": {
      "shadowRadius": 12,
      "shadowOffset": "6,6",
      "shadowColor": "#66000000"
    }
  },
  "1005": {
    "desc": "下拉菜单",
    "border": {
      "width": 1,
      "color": "#20FFFFFF"
    },
    "rounded-corner-radius": "18,18",
    "blur": 30,
    "opcaity": 1,
    "shadow": {
      "shadowRadius": 12,
      "shadowOffset": "6,6",
      "shadowColor": "#66000000"
    }
  },
  "1006": {
    "desc": "工具框",
    "border": {
      "width": 1,
      "color": "#20000000"
    },
    "rounded-corner-radius": "8,8",
    "blur": 30,
    "opcaity": 1,
    "shadow": {
      "shadowRadius": 10,
      "shadowOffset": "10,10",
      "shadowColor": "#33000000"
    }
  }
}

常见问题:修改了gtk标题栏高度之后gtk应用的关闭按钮没了

这是个bug,已经被修复,请升级到最新的内测版解决

{
  "version": 1.0,
  "name": "行云",
  "1001": {
    "desc": "普通窗口",
    "titlebar": {
      "height": 40,
      "area": 1,
      "mouseInputAreaMargins": "5,5,5,5",
      "bgcolor": "white",
      "font-family": "SourceHanSansSC",
      "font-size": 14,
      "text-align": "center",
      "text-color": {
        "active": "#303030",
        "inactive": "#969696"
      },
      "button-group": {
        "menu": {
          "pos": "12,3",
          "icon": {
            "normal": ":/deepin/themes/deepin/dark/icons/menu_normal.svg",
            "hover": ":/deepin/themes/deepin/dark/icons/menu_hover.svg",
            "press": ":/deepin/themes/deepin/dark/icons/menu_press.svg",
            "disabled": ":/deepin/themes/deepin/dark/icons/menu_disabled.svg"
          },
          "width": 37,
          "height": 37,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "minimize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/dark/icons/minimize_normal.svg",
            "hover": ":/deepin/themes/deepin/dark/icons/minimize_hover.svg",
            "press": ":/deepin/themes/deepin/dark/icons/minimize_press.svg",
            "disabled": ":/deepin/themes/deepin/dark/icons/minimize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "maximize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/dark/icons/maximize_normal.svg",
            "hover": ":/deepin/themes/deepin/dark/icons/maximize_hover.svg",
            "press": ":/deepin/themes/deepin/dark/icons/maximize_press.svg",
            "disabled": ":/deepin/themes/deepin/dark/icons/maximize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "unmaximize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/dark/icons/unmaximize_normal.svg",
            "hover": ":/deepin/themes/deepin/dark/icons/unmaximize_hover.svg",
            "press": ":/deepin/themes/deepin/dark/icons/unmaximize_press.svg",
            "disabled": ":/deepin/themes/deepin/dark/icons/unmaximize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "close": {
          "icon": {
            "normal": ":/deepin/themes/deepin/dark/icons/close_normal.svg",
            "hover": ":/deepin/themes/deepin/dark/icons/close_hover.svg",
            "press": ":/deepin/themes/deepin/dark/icons/close_press.svg",
            "disabled": ":/deepin/themes/deepin/dark/icons/close_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        }
      }
    },
    "border": {
      "width": 1,
      "color": "#20000000"
    },
    "rounded-corner-radius": "18,18",
    "blur": 10,
    "opcaity": 1,
    "shadow": {
      "shadowRadius": 40,
      "shadowOffset": "0,30",
      "shadowColor": {
        "active": "#80000000",
        "inactive": "#40000000"
      }
    }
  },
  "1002": {
    "desc": "对话框",
    "titlebar": {
      "height": 40,
      "area": 1,
      "bgcolor": "white",
      "font-family": "SourceHanSansSC",
      "font-size": 14,
      "text-align": "center",
      "text-color": "#000000",
      "button-group": {
        "menu": {
          "pos": "12,3",
          "icon": {
            "normal": ":/deepin/themes/deepin/dark/icons/menu_normal.svg",
            "hover": ":/deepin/themes/deepin/dark/icons/menu_hover.svg",
            "press": ":/deepin/themes/deepin/dark/icons/menu_press.svg",
            "disabled": ":/deepin/themes/deepin/dark/icons/menu_disabled.svg"
          },
          "width": 37,
          "height": 37,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "minimize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/dark/icons/minimize_normal.svg",
            "hover": ":/deepin/themes/deepin/dark/icons/minimize_hover.svg",
            "press": ":/deepin/themes/deepin/dark/icons/minimize_press.svg",
            "disabled": ":/deepin/themes/deepin/dark/icons/minimize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "maximize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/dark/icons/maximize_normal.svg",
            "hover": ":/deepin/themes/deepin/dark/icons/maximize_hover.svg",
            "press": ":/deepin/themes/deepin/dark/icons/maximize_press.svg",
            "disabled": ":/deepin/themes/deepin/dark/icons/maximize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "unmaximize": {
          "icon": {
            "normal": ":/deepin/themes/deepin/dark/icons/unmaximize_normal.svg",
            "hover": ":/deepin/themes/deepin/dark/icons/unmaximize_hover.svg",
            "press": ":/deepin/themes/deepin/dark/icons/unmaximize_press.svg",
            "disabled": ":/deepin/themes/deepin/dark/icons/unmaximize_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        },
        "close": {
          "icon": {
            "normal": ":/deepin/themes/deepin/dark/icons/close_normal.svg",
            "hover": ":/deepin/themes/deepin/dark/icons/close_hover.svg",
            "press": ":/deepin/themes/deepin/dark/icons/close_press.svg",
            "disabled": ":/deepin/themes/deepin/dark/icons/close_disabled.svg"
          },
          "width": 40,
          "height": 40,
          "border": {
            "width": 1,
            "color": "#000000"
          }
        }
      }
    },
    "border": {
      "width": 1,
      "color": "#0F000000"
    },
    "rounded-corner-radius": "18,18",
    "blur": 10,
    "opcaity": 1,
    "shadow": {
      "shadowRadius": 40,
      "shadowOffset": "0,20",
      "shadowColor": "#33000000"
    }
  },
  "1003": {
    "desc": "dock栏",
    "border": {
      "width": 1,
      "color": "#20FFFFFF"
    },
    "rounded-corner-radius": "18,18",
    "blur": 10,
    "opcaity": 0,
    "shadow": {
      "shadowRadius": 14,
      "shadowOffset": "0,2",
      "shadowColor": "20000000"
    }
  },
  "1004": {
    "desc": "右键菜单",
    "border": {
      "width": 1,
      "color": "#20FFFFFF"
    },
    "rounded-corner-radius": "18,18",
    "blur": 30,
    "opcaity": 1,
    "shadow": {
      "shadowRadius": 12,
      "shadowOffset": "6,6",
      "shadowColor": "#66000000"
    }
  },
  "1005": {
    "desc": "下拉菜单",
    "border": {
      "width": 1,
      "color": "#20FFFFFF"
    },
    "rounded-corner-radius": "18,18",
    "blur": 30,
    "opcaity": 1,
    "shadow": {
      "shadowRadius": 12,
      "shadowOffset": "6,6",
      "shadowColor": "#66000000"
    }
  },
  "1006": {
    "desc": "工具框",
    "border": {
      "width": 1,
      "color": "#20000000"
    },
    "rounded-corner-radius": "8,8",
    "blur": 30,
    "opcaity": 1,
    "shadow": {
      "shadowRadius": 10,
      "shadowOffset": "10,10",
      "shadowColor": "#33000000"
    }
  }
}



Reply Favorite View the author
All Replies
pzm9012
Moderator
2023-08-08 23:03
#1

Niiiiice!

Reply View the author
deepin
2023-08-08 23:08
#2

confused

,是DTK标题栏还是GTK标题栏?

Reply View the author
sammy-621
deepin
2023-08-08 23:26
#3

😁

Reply View the author
阿尼樱奈奈
Moderator
2023-08-08 23:37
#4

like

Reply View the author
DebuggerX
deepin
2023-08-08 23:38
#5

我看代码找到的位置是~/.local/share/deepin/themes/deepin/light/decoration.json

另外发现在我这里设置后按钮会消失,所以提了个pr:https://github.com/linuxdeepin/deepin-kwin/pull/203

Reply View the author
神末shenmo
Moderator
Spark-App
2023-08-08 23:44
#6
DebuggerX

我看代码找到的位置是~/.local/share/deepin/themes/deepin/light/decoration.json

另外发现在我这里设置后按钮会消失,所以提了个pr:https://github.com/linuxdeepin/deepin-kwin/pull/203

我编译下,然后塞better deepin23

Reply View the author
DebuggerX
deepin
2023-08-08 23:48
#7
神末shenmo

我编译下,然后塞better deepin23

刚刚merge了

Reply View the author
hanzn-zzx
deepin
2023-08-09 00:17
#8

第一张图那是啥应用?

Reply View the author
阿尼樱奈奈
Moderator
2023-08-09 00:22
#9
hanzn-zzx

第一张图那是啥应用?

就是这个dde-dconfig-editor
image.png

Reply View the author
hanzn-zzx
deepin
2023-08-09 00:27
#10
阿尼樱奈奈

就是这个dde-dconfig-editor
image.png

谢谢!

Reply View the author
神末shenmo
Moderator
Spark-App
2023-08-09 01:31
#11

confused

,是DTK标题栏还是GTK标题栏?

都写了

Reply View the author
秋胜春朝
deepin
2023-08-10 05:16
#12

like

Reply View the author