更新gtk到最新版本制作的应用程序看起来很丑陋

时间:2010-11-29 17:13:08

标签: themes gtk

我原先安装了gtk 2.14.6,通过python 2.5和pygtk 2.12使用它。我刚刚下载了gtk 2.22软件包并将其解压缩,取而代之的是旧版本。 (我没有在旧文件夹中提取它,我只是移动了旧文件夹并在同一个地方提取了新的包)。然而,同样的应用程序从看起来非常像本机Windows 7应用程序看起来非常丑陋,笨重..更像是一个Windows XP主题,但它甚至没有模仿那么好。

GTK主题如何运作?如何获得最新版本的GTK(由于不稳定性问题我更新了),但主题是什么?为什么旧版本看起来比新版本更好?

1 个答案:

答案 0 :(得分:3)

在您的发行版中,在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"