1
0
mirror of https://github.com/moparisthebest/FireTray synced 2024-12-21 21:48:47 -05:00

Add 'middle_click' option.

Mainly intended for AppIndicator. Not used in winnt yet.
This commit is contained in:
foudfou 2014-11-22 18:47:51 +01:00
parent 58130c5a7d
commit 389e6cec51
35 changed files with 176 additions and 25 deletions

View File

@ -53,7 +53,8 @@ var firetrayUIOptions = {
this.hideUnsupportedOptions([
'ui_hides_last_only', 'ui_show_activates', 'ui_remember_desktop',
'app_icon_default', 'ui_show_icon_on_hide', 'ui_scroll_hides',
'ui_radiogroup_scroll', 'ui_scroll_hides', 'newmail_icon_names'
'ui_radiogroup_scroll', 'ui_scroll_hides', 'ui_middle_click',
'newmail_icon_names'
]);
} else if (firetray.AppIndicator) {
this.hideUnsupportedOptions([
@ -88,6 +89,7 @@ var firetrayUIOptions = {
case 'ui_show_icon_on_hide':
case 'ui_scroll_hides':
case 'ui_radiogroup_scroll':
case 'ui_middle_click':
document.getElementById(id).hidden = true;
break;
case 'ui_scroll_hides':

View File

@ -71,6 +71,7 @@
<preference id="pref_show_icon_on_hide" name="extensions.firetray.show_icon_on_hide" type="bool"/>
<preference id="pref_scroll_hides" name="extensions.firetray.scroll_hides" type="bool" />
<preference id="pref_scroll_mode" name="extensions.firetray.scroll_mode" type="string" />
<preference id="pref_middle_click" name="extensions.firetray.middle_click" type="int" />
</preferences>
<vbox pack="start" align="left" flex="1">
@ -120,6 +121,15 @@
<radio id="ui_radio_scroll_up_hides" label="&up;=&hide;, &down;=&restore;" value="up_hides" />
</radiogroup>
<radiogroup id="ui_middle_click" preference="pref_middle_click">
<hbox align="center" flex="1">
<label control="ui_middle_click" value="&middle_click.label;"
accesskey="&middle_click.accesskey;" />
<radio id="ui_middle_click_activate_last" label="&activate_last;" value="0" />
<radio id="ui_middle_click_show_hide" label="&show_hide;" value="1" />
</hbox>
</radiogroup>
</vbox>
</prefpane>

View File

@ -42,6 +42,10 @@
<!ENTITY down "↓" >
<!ENTITY hide "verstecken" >
<!ENTITY restore "wiederherstellen" >
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY mail_notification_enabled.label "Mailbenachrichtigung">
<!ENTITY mail_notification_enabled.accesskey "M">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=Beenden
popupMenu.itemLabel.NewWindow=Neues Fenster
popupMenu.itemLabel.NewMessage=Neue Nachricht
popupMenu.itemLabel.ShowHide=Show/Hide
popupMenu.itemLabel.ActivateLast=Activate last window
tooltip.unread_messages=#1 ungelesene Nachricht;#1 ungelesene Nachrichten
tooltip.new_messages=Neue Nachrichten!

View File

@ -43,6 +43,10 @@
<!ENTITY down "↓" >
<!ENTITY hide "hide" >
<!ENTITY restore "restore" >
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY mail_notification_enabled.label "Enable mail notification">
<!ENTITY mail_notification_enabled.accesskey "a">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=Quit
popupMenu.itemLabel.NewWindow=New window
popupMenu.itemLabel.NewMessage=New message
popupMenu.itemLabel.ShowHide=Show/Hide
popupMenu.itemLabel.ActivateLast=Activate last window
tooltip.unread_messages=#1 unread message;#1 unread messages
tooltip.new_messages=New messages !

View File

@ -38,6 +38,10 @@
<!ENTITY down "↓">
<!ENTITY hide "ocultar">
<!ENTITY restore "restaurar">
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY mail_notification_enabled.label "Habilitar notificaciones por correo">
<!ENTITY mail_notification_enabled.accesskey "H">
<!ENTITY message_count_type.label "tipo de contador de mensajes:">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=Salir
popupMenu.itemLabel.NewWindow=Nueva ventana
popupMenu.itemLabel.NewMessage=Nuevo mensaje
popupMenu.itemLabel.ShowHide=Show/Hide
popupMenu.itemLabel.ActivateLast=Activate last window
tooltip.unread_messages=#1 mensaje no leido;#1 mensajes no leídos
tooltip.new_messages=Nuevos mensajes !

View File

@ -38,6 +38,10 @@
<!ENTITY down "↓">
<!ENTITY hide "masquer">
<!ENTITY restore "restaurer">
<!ENTITY middle_click.label "Souris clic du milieu :" >
<!ENTITY middle_click.accesskey "m" >
<!ENTITY show_hide "Masquer/Restaurer" >
<!ENTITY activate_last "Activer la dernière fenêtre ouverte" >
<!ENTITY mail_notification_enabled.label "Autoriser la notification des courriers">
<!ENTITY mail_notification_enabled.accesskey "A">
<!ENTITY message_count_type.label "compter les messages :">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=Quitter
popupMenu.itemLabel.NewWindow=Nouvelle fenêtre
popupMenu.itemLabel.NewMessage=Nouveau message
popupMenu.itemLabel.ShowHide=Montrer/Cacher
popupMenu.itemLabel.ActivateLast=Activer la dernière fenêtre
tooltip.unread_messages=#1 mesage non lu;#1 messages non lus
tooltip.new_messages=Nouveaux messages !

View File

@ -38,6 +38,10 @@
<!ENTITY down "↓">
<!ENTITY hide "sakrij">
<!ENTITY restore "obnovi">
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY mail_notification_enabled.label "Omogući obavijesti pošte">
<!ENTITY mail_notification_enabled.accesskey "a">
<!ENTITY message_count_type.label "broj vrsta poruka:">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=Zatvori
popupMenu.itemLabel.NewWindow=Novi prozor
popupMenu.itemLabel.NewMessage=Nova poruka
popupMenu.itemLabel.ShowHide=Show/Hide
popupMenu.itemLabel.ActivateLast=Activate last window
tooltip.unread_messages=#1 nepročitana poruka;#1 nepročitano poruka
tooltip.new_messages=Nove poruke!

View File

@ -38,6 +38,10 @@
<!ENTITY down "↓">
<!ENTITY hide "Nascondi">
<!ENTITY restore "Ripristina">
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY mail_notification_enabled.label "Attiva notifiche e-mail">
<!ENTITY mail_notification_enabled.accesskey "a">
<!ENTITY message_count_type.label "Tipo di contatore messaggi:">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=Esci
popupMenu.itemLabel.NewWindow=Nuova finestra
popupMenu.itemLabel.NewMessage=Nuovo messaggio
popupMenu.itemLabel.ShowHide=Show/Hide
popupMenu.itemLabel.ActivateLast=Activate last window
tooltip.unread_messages=#1 messaggio non letto;#1 messaggi non letti
tooltip.new_messages=Nuovi messaggi

View File

@ -38,6 +38,10 @@
<!ENTITY down "↓">
<!ENTITY hide "verbergen">
<!ENTITY restore "herstellen">
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY mail_notification_enabled.label "E-mailnotificatie inschakelen">
<!ENTITY mail_notification_enabled.accesskey "a">
<!ENTITY message_count_type.label "type berichttelling:">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=Stoppen
popupMenu.itemLabel.NewWindow=Nieuw venster
popupMenu.itemLabel.NewMessage=Nieuw bericht
popupMenu.itemLabel.ShowHide=Show/Hide
popupMenu.itemLabel.ActivateLast=Activate last window
tooltip.unread_messages=#1 ongelezen bericht;#1 ongelezen berichten
tooltip.new_messages=Nieuwe berichten!

View File

@ -43,6 +43,10 @@
<!ENTITY down "↓" >
<!ENTITY hide "ukrywa" >
<!ENTITY restore "przywraca" >
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY mail_notification_enabled.label "Włącz powiadomienie o poczcie">
<!ENTITY mail_notification_enabled.accesskey "i">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=Wyjdź
popupMenu.itemLabel.NewWindow=Nowe okno
popupMenu.itemLabel.NewMessage=Nowa wiadomość
popupMenu.itemLabel.ShowHide=Show/Hide
popupMenu.itemLabel.ActivateLast=Activate last window
tooltip.unread_messages=#1 nieprzeczytana wiadomość;#1 nieprzeczytane wiadomości
tooltip.new_messages=Nowe wiadomości !

View File

@ -43,6 +43,10 @@
<!ENTITY down "↓" >
<!ENTITY hide "скрыть" >
<!ENTITY restore "показать" >
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY mail_notification_enabled.label "Включить оповещение о новых сообщениях">
<!ENTITY mail_notification_enabled.accesskey "a">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=Выход
popupMenu.itemLabel.NewWindow=Новое окно
popupMenu.itemLabel.NewMessage=Создать сообщение
popupMenu.itemLabel.ShowHide=Show/Hide
popupMenu.itemLabel.ActivateLast=Activate last window
tooltip.unread_messages=#1 непрочитанных сообщений;#1 непрочитанных сообщений
tooltip.new_messages=Новые сообщения !

View File

@ -43,6 +43,10 @@
<!ENTITY down "↓" >
<!ENTITY hide "skryť" >
<!ENTITY restore "obnoviť" >
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY mail_notification_enabled.label "Zapnúť upozornenia pošty">
<!ENTITY mail_notification_enabled.accesskey "a">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=Koniec
popupMenu.itemLabel.NewWindow=Nové okno
popupMenu.itemLabel.NewMessage=Nová správa
popupMenu.itemLabel.ShowHide=Show/Hide
popupMenu.itemLabel.ActivateLast=Activate last window
tooltip.unread_messages=#1 neprečítaná správa;#1 neprečítané správy;#1 neprečítaných správ
tooltip.new_messages=Nové správy!

View File

@ -43,6 +43,10 @@
<!ENTITY down "↓">
<!ENTITY hide "сховати">
<!ENTITY restore "відновити">
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY mail_notification_enabled.label "Включити поштові повідомлення">
<!ENTITY mail_notification_enabled.accesskey "ю">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=Вийти
popupMenu.itemLabel.NewWindow=Нове вікно
popupMenu.itemLabel.NewMessage=Нове повідомлення
popupMenu.itemLabel.ShowHide=Show/Hide
popupMenu.itemLabel.ActivateLast=Activate last window
tooltip.unread_messages=#1 непрочитане повідомлення;#1 непрочитані повідомлення
tooltip.new_messages=Нові повідомлення!

View File

@ -38,6 +38,10 @@
<!ENTITY down "↓">
<!ENTITY hide "隱藏">
<!ENTITY restore "恢復">
<!ENTITY middle_click.label "Mouse middle click action :" >
<!ENTITY middle_click.accesskey "k" >
<!ENTITY show_hide "Show/hide" >
<!ENTITY activate_last "Activate last window" >
<!ENTITY mail_notification_enabled.label "啟用郵件通知">
<!ENTITY mail_notification_enabled.accesskey "A">
<!ENTITY message_count_type.label "郵件計數器類型:">

View File

@ -5,5 +5,6 @@ popupMenu.itemLabel.Quit=結束
popupMenu.itemLabel.NewWindow=開新視窗
popupMenu.itemLabel.NewMessage=新增訊息
popupMenu.itemLabel.ShowHide=Show/Hide
popupMenu.itemLabel.ActivateLast=Activate last window
tooltip.unread_messages=#1 封未讀訊息;#1 封未讀訊息
tooltip.new_messages=有新訊息!

View File

@ -15,12 +15,12 @@ treechildren::-moz-tree-checkbox(checked, disabled) {
/* properties="disabled" */
treechildren::-moz-tree-cell-text(disabled) {
color: GrayText;
color: GrayText;
}
/*
treechildren::-moz-tree-cell(disabled) {
background-color: #eeeeee;
background-color: #eeeeee;
}
*/

View File

@ -21,6 +21,7 @@ pref("extensions.firetray.new_mail_icon_names", '["indicator-messages-new", "mai
pref("extensions.firetray.show_icon_on_hide", false);
pref("extensions.firetray.scroll_hides", true);
pref("extensions.firetray.scroll_mode", "down_hides");
pref("extensions.firetray.middle_click", 0);
pref("extensions.firetray.chat_icon_enable", true);
pref("extensions.firetray.chat_icon_blink", true);
pref("extensions.firetray.chat_icon_blink_style", 0);

View File

@ -571,6 +571,10 @@ firetray.PrefListener = new PrefListener(
firetray.Messaging.updateMsgCountWithCb();
break;
case 'middle_click':
firetray.StatusIcon.middleClickActionChanged();
break;
case 'chat_icon_enable':
firetray.Handler.toggleChat(firetray.Handler.isChatEnabled());
break;

View File

@ -3,10 +3,11 @@
/* for now, logging facilities (imported from logging.jsm) and Services are
automatically provided by this module */
var EXPORTED_SYMBOLS =
[ "firetray", "FIRETRAY_VERSION", "FIRETRAY_OS_SUPPORT",
"FIRETRAY_ID", "FIRETRAY_PREF_BRANCH", "FIRETRAY_SPLASH_PAGE",
[ "firetray", "FIRETRAY_VERSION", "FIRETRAY_OS_SUPPORT", "FIRETRAY_ID",
"FIRETRAY_PREF_BRANCH", "FIRETRAY_SPLASH_PAGE",
"FIRETRAY_APPLICATION_ICON_TYPE_THEMED",
"FIRETRAY_APPLICATION_ICON_TYPE_CUSTOM",
"FIRETRAY_MIDDLE_CLICK_ACTIVATE_LAST", "FIRETRAY_MIDDLE_CLICK_SHOW_HIDE",
"FIRETRAY_NOTIFICATION_MESSAGE_COUNT",
"FIRETRAY_NOTIFICATION_NEWMAIL_ICON", "FIRETRAY_NOTIFICATION_CUSTOM_ICON",
"FIRETRAY_IM_STATUS_AVAILABLE", "FIRETRAY_IM_STATUS_AWAY",
@ -33,6 +34,9 @@ const FIRETRAY_SPLASH_PAGE = "http://foudfou.github.com/FireTray/";
const FIRETRAY_APPLICATION_ICON_TYPE_THEMED = 0;
const FIRETRAY_APPLICATION_ICON_TYPE_CUSTOM = 1;
const FIRETRAY_MIDDLE_CLICK_ACTIVATE_LAST = 0;
const FIRETRAY_MIDDLE_CLICK_SHOW_HIDE = 1;
const FIRETRAY_MESSAGE_COUNT_TYPE_UNREAD = 0;
const FIRETRAY_MESSAGE_COUNT_TYPE_NEW = 1;

View File

@ -40,14 +40,11 @@ firetray.AppIndicator = {
this.addCallbacks();
for (let item in firetray.PopupMenu.menuShowHide) {
firetray.PopupMenu.showItem(firetray.PopupMenu.menuShowHide[item]);
for (let item in firetray.PopupMenu.menuItem) {
firetray.PopupMenu.showItem(firetray.PopupMenu.menuItem[item]);
}
let menuItemShowHideWidget = ctypes.cast(
firetray.PopupMenu.menuShowHide.item, gtk.GtkWidget.ptr);
// FIXME: XXX should be option ShowHide or ActivateLast
appind3.app_indicator_set_secondary_activate_target(
this.indicator, menuItemShowHideWidget);
this.attachMiddleClickCallback();
firetray.Handler.setIconTooltipDefault();
this.initialized = true;
@ -72,6 +69,24 @@ firetray.AppIndicator = {
firetray.AppIndicator.callbacks.onScroll, null);
},
attachMiddleClickCallback: function(pref) {
let pref = firetray.Utils.prefService.getIntPref("middle_click");
if (pref === FIRETRAY_MIDDLE_CLICK_ACTIVATE_LAST) {
item = firetray.PopupMenu.menuItem.activateLast;
firetray.PopupMenu.showItem(firetray.PopupMenu.menuItem.activateLast);
} else if (pref === FIRETRAY_MIDDLE_CLICK_SHOW_HIDE) {
item = firetray.PopupMenu.menuItem.showHide;
firetray.PopupMenu.hideItem(firetray.PopupMenu.menuItem.activateLast);
} else {
log.error("Unknown pref value for 'middle_click': "+pref);
return false;
}
let menuItemShowHideWidget = ctypes.cast(item, gtk.GtkWidget.ptr);
appind3.app_indicator_set_secondary_activate_target(
this.indicator, menuItemShowHideWidget);
return true;
},
onConnectionChanged: function(indicator, connected, data) {
log.debug("AppIndicator connection-changed: "+connected);
},
@ -90,6 +105,12 @@ firetray.StatusIcon.initImpl =
firetray.StatusIcon.shutdownImpl =
firetray.AppIndicator.shutdown.bind(firetray.AppIndicator);
firetray.StatusIcon.middleClickActionChanged = function() {
log.debug("middleClickActionChanged");
firetray.AppIndicator.attachMiddleClickCallback();
};
firetray.Handler.setIconImageDefault = function() {
log.debug("setIconImageDefault");
appind3.app_indicator_set_icon(firetray.AppIndicator.indicator,
@ -116,7 +137,7 @@ firetray.Handler.setIconTooltip = function(toolTipStr) {
log.debug("setIconTooltip");
if (!firetray.AppIndicator.indicator)
return false;
firetray.PopupMenu.setItemLabel(firetray.PopupMenu.menuShowHide.tip,
firetray.PopupMenu.setItemLabel(firetray.PopupMenu.menuItem.tip,
toolTipStr);
return true;
};

View File

@ -104,11 +104,37 @@ firetray.GtkStatusIcon = {
"activate", firetray.GtkStatusIcon.callbacks.iconActivate, null);
log.debug("g_connect activate="+handlerId);
this.callbacks.iconMiddleClick = gtk.GCallbackStatusIconMiddleClick_t(
firetray.Handler.activateLastWindowCb, null, FIRETRAY_CB_SENTINEL);
handlerId = gobject.g_signal_connect(firetray.GtkStatusIcon.trayIcon,
"button-press-event", firetray.GtkStatusIcon.callbacks.iconMiddleClick, null);
log.debug("g_connect middleClick="+handlerId);
let pref = firetray.Utils.prefService.getIntPref("middle_click");
this.attachMiddleClickCallback(pref);
},
attachMiddleClickCallback: function(pref) {
log.debug("attachMiddleClickCallback pref="+pref);
if (pref === FIRETRAY_MIDDLE_CLICK_ACTIVATE_LAST) {
this.callbacks.iconMiddleClick = gtk.GCallbackStatusIconMiddleClick_t(
firetray.Handler.activateLastWindowCb, null, FIRETRAY_CB_SENTINEL);
} else if (pref === FIRETRAY_MIDDLE_CLICK_SHOW_HIDE) {
this.callbacks.iconMiddleClick = gtk.GCallbackStatusIconMiddleClick_t(
function(widget, event, data) {firetray.Handler.showHideAllWindows(); return true;},
null, FIRETRAY_CB_SENTINEL);
} else {
log.error("Unknown pref value for 'middle_click': "+pref);
return;
}
this.callbacks.iconMiddleClickId = gobject.g_signal_connect(
firetray.GtkStatusIcon.trayIcon,
"button-press-event", firetray.GtkStatusIcon.callbacks.iconMiddleClick,
null);
log.debug("g_connect middleClick="+this.callbacks.iconMiddleClickId);
},
detachMiddleClickCallback: function() {
log.debug("detachMiddleClickCallback");
gobject.g_signal_handler_disconnect(
firetray.GtkStatusIcon.trayIcon,
gobject.gulong(this.callbacks.iconMiddleClickId)
);
delete this.callbacks.iconMiddleClickId;
},
onScroll: function(icon, event, data) {
@ -150,6 +176,14 @@ firetray.StatusIcon.initImpl =
firetray.StatusIcon.shutdownImpl =
firetray.GtkStatusIcon.shutdown.bind(firetray.GtkStatusIcon);
firetray.StatusIcon.middleClickActionChanged = function() {
log.debug("middleClickActionChanged");
let pref = firetray.Utils.prefService.getIntPref("middle_click");
firetray.GtkStatusIcon.detachMiddleClickCallback();
firetray.GtkStatusIcon.attachMiddleClickCallback(pref);
};
firetray.Handler.loadIcons = firetray.GtkStatusIcon.loadThemedIcons;
firetray.Handler.setIconImageDefault = function() {

View File

@ -21,14 +21,14 @@ if ("undefined" == typeof(firetray.StatusIcon))
firetray.PopupMenu = {
MENU_ITEM_WINDOWS_POSITION: 3,
MENU_ITEM_WINDOWS_POSITION: 4,
initialized: false,
callbacks: {menuItemWindowActivate: {}}, // FIXME: try to store them into a ctypes array/struct.
menu: null,
menuShell: null,
menuSeparatorWindows: null,
menuShowHide: {tip: null, sep: null, item: null},
menuItem: {tip: null, showHide: null, activateLast: null, sep: null},
init: function() {
this.menu = gtk.gtk_menu_new();
@ -113,15 +113,21 @@ firetray.PopupMenu = {
},
prependAppIndicatorItems: function() {
this.menuShowHide.sep = gtk.gtk_separator_menu_item_new();
gtk.gtk_menu_shell_prepend(this.menuShell, ctypes.cast(this.menuShowHide.sep,
this.menuItem.sep = gtk.gtk_separator_menu_item_new();
gtk.gtk_menu_shell_prepend(this.menuShell, ctypes.cast(this.menuItem.sep,
gtk.GtkWidget.ptr));
this.menuShowHide.item = this.addItem({
this.menuItem.activateLast = this.addItem({
itemName:"ActivateLast", iconName:null, action:"activate", callback:
firetray.Handler.showAllWindowsAndActivate, inFront: true});
this.menuItem.showHide = this.addItem({
itemName:"ShowHide", iconName:"gtk-go-down", action:"activate", callback:
firetray.Handler.showHideAllWindows, inFront: true});
this.menuShowHide.tip = this.createAndAddItemToMenuAt(0);
this.menuItem.tip = this.createAndAddItemToMenuAt(0);
gtk.gtk_widget_set_sensitive(
ctypes.cast(this.menuShowHide.tip, gtk.GtkWidget.ptr), false);
ctypes.cast(this.menuItem.tip, gtk.GtkWidget.ptr), false);
},
popup: function(icon, button, activateTime, menu) {

View File

@ -391,6 +391,7 @@ firetray.Window.xSendClientMessgeEvent = function(xid, atom, data, dataSize) {
* raises window on top and give focus.
*/
firetray.Window.activate = function(xid) {
// broken in KDE ?
gtk.gtk_window_present(firetray.Handler.gtkWindows.get(xid));
log.debug("window raised");
};

View File

@ -258,6 +258,14 @@ firetray.StatusIcon = {
user32.SetForegroundWindow(hWnd);
user32.TrackPopupMenu(firetray.PopupMenu.menu, user32.TPM_RIGHTALIGN|user32.TPM_BOTTOMALIGN, xPos, yPos, 0, hWnd, null);
break;
case win32.WM_MBUTTONUP:
log.debug("WM_MBUTTONUP");
break;
// case win32.WM_VSCROLL:
// case win32.WM_MOUSEWHEEL:
/* getting scroll event from the icon is not straight-forward:
SetWindowsHookEx, http://stackoverflow.com/a/90793/421846,
http://www.codeproject.com/Articles/21218/Tray-Me */
default:
}