2010-11-29 69 views
1

我初步安裝了gtk 2.14.6,通過python 2.5使用pygtk 2.12。我只是下載了gtk 2.22軟件包並提取它,取代了舊軟件。 (我沒有將它提取到舊文件夾中,我只是移動舊文件夾並在同一位置提取新的文件夾)。然而,同樣的應用程序看起來非常像一個本地Windows 7應用程序,看起來非常醜陋,笨拙......更像是Windows XP主題,但它甚至沒有模仿那麼好。更新gtk到最新版本使應用程序看起來UGLY

GTK主題是如何工作的?我如何獲得GTK的最新版本(由於不穩定性問題我已更新),但具有主題?爲什麼舊版本比新版本更好?

回答

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" 
+0

哇,完美,謝謝!我的gtkrc文件實際上缺失。我不知道爲什麼它不會包含在捆綁包中。 – Claudiu 2010-11-30 16:37:05

相關問題