Небольшая доработка pidgin (в плане цветов)

FreeBSD, NetBSD, OpenBSD, DragonFly и т. д.

Модератор: arachnid

Аватара пользователя
AlexNT
Сообщения: 433
ОС: FreeBSD 8.2, ArchLinux

Небольшая доработка pidgin

Сообщение AlexNT »

За долгое время использования pidgin мне не хватало возможности настроить цвета уведомлений в табах, и цвета ников в чатах. Как оказалось, цвета уведомлений жестко заданы в исходном коде программы, а цвета ников генерируются случайным образом и часто ужасно смотрятся на сером и светлом фоне.

Для доработки внешнего вида пришлось написать такой вот патч:

Скачать можно тут: http://www.bsdnotes.ru/patches/pidgin/patch-color_tabs
Следует положить в /usr/ports/net-im/libpurple/files и пересобрать libpurple и pidgin

Код: Выделить всё

--- pidgin/gtkconv.c.orig       2008-03-08 13:10:52.000000000 -0500
+++ pidgin/gtkconv.c            2008-03-08 13:10:52.000000000 -0500
@@ -8133,5 +8133,5 @@
-                       {"pidgin_tab_label_typing_default", "tab-label-typing", "#4e9a06"},
-                       {"pidgin_tab_label_typed_default", "tab-label-typed", "#c4a000"},
-                       {"pidgin_tab_label_attention_default", "tab-label-attention", "#006aff"},
-                       {"pidgin_tab_label_unreadchat_default", "tab-label-unreadchat", "#cc0000"},
-                       {"pidgin_tab_label_event_default", "tab-label-event", "#888a85"},
+                       {"pidgin_tab_label_typing_default", "tab-label-typing", "#244803"},
+                       {"pidgin_tab_label_typed_default", "tab-label-typed", "#645200"},
+                       {"pidgin_tab_label_attention_default", "tab-label-attention", "#00167a"},
+                       {"pidgin_tab_label_unreadchat_default", "tab-label-unreadchat", "#4f0000"},
+                       {"pidgin_tab_label_event_default", "tab-label-event", "#3e3e3e"},
@@ -10261,1 +10261,1 @@
-               GdkColor color = nick_seed_colors[j];
+               GdkColor color = { 0, 10000, 0, 0 };
@@ -10280,1 +10280,1 @@
-               GdkColor color = { 0, rand() % 65536, rand() % 65536, rand() % 65536 };
+               GdkColor color = { 0, 10000, 0, 0 };

Как pidgin выглядит до и после патча можно посмотреть на картинках.
Вопрос в том, можно ли как нибудь настроить эти параметры не прибегая к вмешательству в исходные коды программы?
У вас нет необходимых прав для просмотра вложений в этом сообщении.
Спасибо сказали:
Аватара пользователя
Karras
Сообщения: 137
Статус: Человек без Вантуза
ОС: Что-то Линуксовое)))

Re: Небольшая доработка pidgin

Сообщение Karras »

Как-то не понравилось...
"Нам уже давно за тридцать... "(с)
Спасибо сказали:
Аватара пользователя
AlexNT
Сообщения: 433
ОС: FreeBSD 8.2, ArchLinux

Re: Небольшая доработка pidgin

Сообщение AlexNT »

Karras писал(а):
02.10.2009 22:36
Как-то не понравилось...


Вопрос не в том, понравилось или нет, вопрос в том, можно ли регулировать эти параметры не вмешиваясь в исходные коды...
Через тему .gtkrc-2.0 допустим?!
Спасибо сказали:
Аватара пользователя
Shura
Сообщения: 1537
Статус: Оказывается и без KDE есть жизнь
ОС: FreeBSD 8.0-RC2

Re: Небольшая доработка pidgin

Сообщение Shura »

Если они прописаны в самой программе, то никак.
Rock'n'roll мертв © БГ
Спасибо сказали:
Аватара пользователя
AlexNT
Сообщения: 433
ОС: FreeBSD 8.2, ArchLinux

Re: Небольшая доработка pidgin

Сообщение AlexNT »

Shura писал(а):
03.10.2009 16:44
Если они прописаны в самой программе, то никак.


Как оказалось кое какие параметры задаются через тему .gtkrc-2.0 включая некоторые параметры цветов:

Код: Выделить всё

# When turned on, this option causes gtk to select the contents of an entry field when it becomes focused.
gtk-entry-select-on-focus = 1

# Sets the font used by gtk
gtk-font-name = "Verdana 9"

# Controls the keybindings that gtk uses for text entry/editing/etc
# The "emacs" theme turns on things like:
# ctrl-a == move to beginning of line, ctrl-e == move to end of line, etc.
gtk-key-theme-name = "Emacs"

# The following section allows you to change the style of the conversation
# window widgets, log viewer widget, and request and notify window widgets.
style "imhtml-fix"
{
font_name = "Sans 10"
}
# Set the widget style for the conversation entry box
widget "*pidgin_conv_entry" style "imhtml-fix"
# Set the widget style for the conversation
widget "*pidgin_conv_imhtml" style "imhtml-fix"

# Set the widget style for the log viewer
widget "*pidgin_log_imhtml" style "imhtml-fix"

# Set the widget style for IMHtml input widgets in request dialogs
widget "*pidgin_request_imhtml" style "imhtml-fix"
# Set the widget style for IMHtml widgets in notify dialogs
widget "*pidgin_notify_imhtml" style "imhtml-fix"

# It is safe to remove any undesired settings from the following
style "my-style-name" {
  # Change the color of hyperlinks.
  GtkIMHtml::hyperlink-color = "#000080"
  # Change the color of the nick in highlighted messages, e.g. messages containing your nick
  GtkIMHtml::highlight-name-color = "#AF7F00"
  # Change the color of the nick in received message
  GtkIMHtml::receive-name-color = "#cc0000"
  # Change the color of the nick in sent message
  GtkIMHtml::send-name-color = "#204a87"
  # Change the color of the nick in action messages, e.g. "/me likes pidgin"
  GtkIMHtml::action-name-color = "#062585"
  # Change the font of the typing notification in conversation history.
  GtkIMHtml::typing-notification-font = "italic light 8.0"
  # Change the color of the typing notification
  GtkIMHtml::typing-notification-color = "#ff0000"
  # Disable the typing notification
  GtkIMHtml::typing-notification-enable = 0

  # The following settings will change the behaviour in all GTK+ applications
  # Change the cursor color
  GtkWidget::cursor-color    = "#0000FF"
  GtkWidget::secondary-cursor-color = "#00FF00" #for mixed ltr and rtl
}
widget_class "*" style "my-style-name"

# This sets the expander size on a treeview to 0, which has the result
# of reducing the indent for items in the tree. This can be applied to the
# Pidgin buddy list to reduce the width of group and contact rows.
# With the recent (~2.0.0) buddy list changes this isn't particularly
# important anymore.
#style "my-narrow-tree"
#{
#  GtkTreeView::expander_size = 0
#}
# And apply the style to the buddy list:
#widget "*pidgin_blist_treeview" style "my-narrow-tree"

# In Pidgin, you can set custom keybindings in your theme.
# Here is an example to follow:

binding "my-bindings"
{
# enter inserts a newline
        bind "Return" { "insert-at-cursor" ("\n") }
# ctrl-s sends message
        bind "<ctrl>s" { "message_send" () }
# shift-f1 toggles bold
        bind "<shft>F1" { "format_toggle" (1) }
# alt-f2 toggles italic
        bind "<alt>F2" { "format_toggle" (2) }
# Ctrl-alt-shift-f3 toggles underline
        bind "<ctrl><alt><shift>F3" { "format_toggle" (4) }
}

widget "*pidgin_conv_entry" binding "my-bindings"

# This lets you edit your Pidgin key bindings from within Pidgin,
# by hovering over a menu item and hitting a key combo.
gtk-can-change-accels = 1
Спасибо сказали:
Аватара пользователя
Shura
Сообщения: 1537
Статус: Оказывается и без KDE есть жизнь
ОС: FreeBSD 8.0-RC2

Re: Небольшая доработка pidgin

Сообщение Shura »

Даже те, которые жёстко прописаны в программе?
Rock'n'roll мертв © БГ
Спасибо сказали:
Аватара пользователя
AlexNT
Сообщения: 433
ОС: FreeBSD 8.2, ArchLinux

Re: Небольшая доработка pidgin

Сообщение AlexNT »

Shura писал(а):
07.10.2009 11:25
Даже те, которые жёстко прописаны в программе?


Они прописаны как переменные, что там с ними дальше происходит я же не смотрел. Не настолько я понимаю C. Поэтому и спрашивал.
Может там проверка идет, смотрим если нет в gtk теме, то берем жестко прописанную переменную...
Ну так или иначе это уже не важно, я уже достиг того что мне было нужно поправить в pidgin для себя.
Спасибо сказали: