From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Change the look of dialogs created with `x-popup-dialog' Date: Tue, 13 Dec 2011 08:07:52 +0100 Message-ID: <890BD378-D3CE-41CE-AEC0-7CEAA1D8CE05@swipnet.se> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1323760088 17044 80.91.229.12 (13 Dec 2011 07:08:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2011 07:08:08 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andrey Smirnov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 13 08:08:04 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RaMT6-0004yr-AW for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2011 08:08:04 +0100 Original-Received: from localhost ([::1]:49705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaMT5-0002KY-Mc for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2011 02:08:03 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaMT2-0002KS-Qg for emacs-devel@gnu.org; Tue, 13 Dec 2011 02:08:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaMT1-0004Bu-Ik for emacs-devel@gnu.org; Tue, 13 Dec 2011 02:08:00 -0500 Original-Received: from mailout.melmac.se ([62.20.26.67]:44160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaMT1-0004Ar-5W for emacs-devel@gnu.org; Tue, 13 Dec 2011 02:07:59 -0500 Original-Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.melmac.se (Postfix) with ESMTP id D281BC137 for ; Tue, 13 Dec 2011 08:07:53 +0100 (CET) Original-Received: (qmail 3663 invoked by uid 89); 13 Dec 2011 07:07:23 -0000 Original-Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 13 Dec 2011 07:07:23 -0000 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 141667FA058; Tue, 13 Dec 2011 08:07:53 +0100 (CET) In-Reply-To: X-Mailer: Apple Mail (2.1251.1) X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 62.20.26.67 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146683 Archived-At: Hello. The change looks good in principle, the current dialog when closing = Emacs with unsaved changes contains way too many buttons. How does that = look on your new implementation? Should the radiobuttons be grouped = into two columns when the exceed some number, say 4 or 6 for example? The code has issues however: You have removed the title, that is no good. Several window managers = show the title in icon bars and other places, so keep the title even if = you add an icon. The use of default bold indicates screaming to me. It should not be = default. A configure option is OK. Ditto font size larger. Not sure if this is a good default. The use of markup opens up the possibility of having markup in the text = for the dialog. Also, some characters will not display right, as they = will be interpretered as masrkup. You need to escape the text with = g_markup_escape in glib. Radio buttons should not have any callbacks. When OK is pressed you = should check what radiobutton is selected and then call the callback. = Just selecting a radio button should not execute any code if there are = OK and Cancel buttons present. Also the select callback pops down the = dialog. This is not something a radiobutton should do. + g_signal_connect (G_OBJECT (ok), "clicked", deactivate_cb, = 0); + g_signal_connect (G_OBJECT (cancel), "clicked", select_cb, = 0); + g_signal_connect (G_OBJECT (cancel), "clicked", = deactivate_cb, 0); Why select_cb on the cancel button? It is not right. You should make a = new function that ok is bound to that extracts the selected radiobutton = and calls select_cb. - popup_activated_flag =3D 0; Do not remove this line. It is needed. Why are you removing it? Jan D. 11 dec 2011 kl. 16:01 skrev Andrey Smirnov: > Hello everybody, >=20 > I often close emacs with mouse by pressing 'close' buttons of its > window and therefore I often encounter questions presented in form of > dialogs produced by `x-popup-dialog' function. I know it is the matter > of one's taste, but I think that appearance of aforementioned dialogs > could be improved by making them look more similar to those created by > other Gtk and GNOME applications(I used GEdit as a template). The > patch in attachment is my attempt to implements such changes. To > summarize it does the following: >=20 > - Adds, depending on the dialog type, appropriate icon to the dialog, > one of GTK_STOCK_DIALOG_INFO or GTK_STOCK_DIALOG_QUESTION. > - Removes resize button from the resulting dialog window. > - For dialogs with more than two buttons, radio-buttons instead of > regular buttons are created. > - Makes the question to be rendered in bold font. >=20 > The difference between the results of `x-popup-dialog' can be seen on > the image in the attachment. >=20 > I guess, there are probably many improvements that can be added both > to the dialog's appearance and to other code of the patch, so at this > point I would like you to ask to comment on the patch. >=20 > Andrey Smirnov > = <0001-Change-the-look-of-dialogs-created-with-x-popup-dial.patch>