将 gtk 更新到最新版本使应用程序看起来很丑

发布于 2024-10-04 19:56:56 字数 276 浏览 2 评论 0原文

我之前安装了 gtk 2.14.6,通过 python 2.5 和 pygtk 2.12 使用它。我刚刚下载了 gtk 2.22 捆绑包并将其解压,替换了旧的捆绑包。 (我没有将其解压到旧文件夹上,我只是移动了旧文件夹并将新包解压到同一位置)。然而,同一个应用程序从看起来非常像原生 Windows 7 应用程序变得非常丑陋、笨重……更像是 Windows XP 主题,但它甚至没有模仿得那么好。

GTK 主题如何工作?我怎样才能获得最新版本的GTK(我由于不稳定问题而更新),但有主题?为什么旧版本看起来比新版本更好?

I preivously had gtk 2.14.6 installed, using it through python 2.5 with pygtk 2.12. I just downloaded the gtk 2.22 bundle and extracted it, replacing the old one. (I didn't extract it over the old folder, I just moved the old folder and extracted the new bundle in the same place). However, the same app went from looking very much like a native Windows 7 app to looking very ugly, clunky.. more like a Windows XP theme but it didn't even mimic that well.

How does GTK theming work? How can I get the newest version of GTK (I updated due to instability issues), but have the theme? And why did the older version look better than the newer one?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

╰沐子 2024-10-11 19:56:56

在您的发行版中,在 etc/gtk-2.0/gtkrc 中,您需要确保“style”设置为“msw-default”,引擎设置为“wimp”。这是我的整个 gtkrc,只是为了确保您拥有它:

gtk-icon-sizes = "gtk-menu=13,13:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24:gtk-dnd=32,32"
gtk-toolbar-icon-size = small-toolbar

# disable images in buttons. i've only seen ugly delphi apps use this feature.
gtk-button-images = 1

# enable/disable images in menus. most "stock" microsoft apps don't use these, except sparingly.
# the office apps use them heavily, though.
gtk-menu-images = 1

# use the win32 button ordering instead of the GNOME HIG one, where applicable
gtk-alternative-button-order = 1

# use the win32 sort indicators direction, as in Explorer
gtk-alternative-sort-arrows = 1

# Windows users don't expect the PC Speaker beeping at them when they backspace in an empty textview and stuff like that
gtk-error-bell = 0

style "msw-default"
{
  GtkWidget::interior-focus = 1
  GtkOptionMenu::indicator-size = { 9, 5 }
  GtkOptionMenu::indicator-spacing = { 7, 5, 2, 2 }
  GtkSpinButton::shadow-type = in

  # Owen and I disagree that these should be themable
  GtkUIManager::add-tearoffs = 0
  #GtkComboBox::add-tearoffs = 0

  GtkComboBox::appears-as-list = 1
  GtkComboBox::focus-on-click = 0

  GOComboBox::add_tearoffs = 0

  GtkTreeView::allow-rules = 0
  GtkTreeView::expander-size = 12

  GtkExpander::expander-size = 12

  GtkScrolledWindow::scrollbar_spacing = 1

  GtkSeparatorMenuItem::horizontal-padding = 2

  engine "wimp" 
  {
  }

 }
class "*" style "msw-default"

binding "ms-windows-tree-view"
{
  bind "Right" { "expand-collapse-cursor-row" (1,1,0) }
  bind "Left" { "expand-collapse-cursor-row" (1,0,0) }
}

class "GtkTreeView" binding "ms-windows-tree-view"

style "msw-combobox-thickness" = "msw-default"
{
  xthickness = 0 
  ythickness = 0
}


widget_class "*TreeView*ComboBox*" style "msw-combobox-thickness"
widget_class "*ComboBox*GtkFrame*" style "msw-combobox-thickness"

In your distribution, in etc/gtk-2.0/gtkrc, you need to make sure that "style" is set to "msw-default" and engine set to "wimp". Here's my entire gtkrc, just to make sure you have it:

gtk-icon-sizes = "gtk-menu=13,13:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24:gtk-dnd=32,32"
gtk-toolbar-icon-size = small-toolbar

# disable images in buttons. i've only seen ugly delphi apps use this feature.
gtk-button-images = 1

# enable/disable images in menus. most "stock" microsoft apps don't use these, except sparingly.
# the office apps use them heavily, though.
gtk-menu-images = 1

# use the win32 button ordering instead of the GNOME HIG one, where applicable
gtk-alternative-button-order = 1

# use the win32 sort indicators direction, as in Explorer
gtk-alternative-sort-arrows = 1

# Windows users don't expect the PC Speaker beeping at them when they backspace in an empty textview and stuff like that
gtk-error-bell = 0

style "msw-default"
{
  GtkWidget::interior-focus = 1
  GtkOptionMenu::indicator-size = { 9, 5 }
  GtkOptionMenu::indicator-spacing = { 7, 5, 2, 2 }
  GtkSpinButton::shadow-type = in

  # Owen and I disagree that these should be themable
  GtkUIManager::add-tearoffs = 0
  #GtkComboBox::add-tearoffs = 0

  GtkComboBox::appears-as-list = 1
  GtkComboBox::focus-on-click = 0

  GOComboBox::add_tearoffs = 0

  GtkTreeView::allow-rules = 0
  GtkTreeView::expander-size = 12

  GtkExpander::expander-size = 12

  GtkScrolledWindow::scrollbar_spacing = 1

  GtkSeparatorMenuItem::horizontal-padding = 2

  engine "wimp" 
  {
  }

 }
class "*" style "msw-default"

binding "ms-windows-tree-view"
{
  bind "Right" { "expand-collapse-cursor-row" (1,1,0) }
  bind "Left" { "expand-collapse-cursor-row" (1,0,0) }
}

class "GtkTreeView" binding "ms-windows-tree-view"

style "msw-combobox-thickness" = "msw-default"
{
  xthickness = 0 
  ythickness = 0
}


widget_class "*TreeView*ComboBox*" style "msw-combobox-thickness"
widget_class "*ComboBox*GtkFrame*" style "msw-combobox-thickness"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文