all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Change the look of dialogs created with `x-popup-dialog'
Date: Tue, 13 Dec 2011 21:29:58 -0800	[thread overview]
Message-ID: <CAHQ1cqGXk+Kcp6F0sdHdrwMkm=ZkhASkUhsWs0r6eD-MhBbD3A@mail.gmail.com> (raw)
In-Reply-To: <890BD378-D3CE-41CE-AEC0-7CEAA1D8CE05@swipnet.se>

On Mon, Dec 12, 2011 at 11:07 PM, Jan Djärv <jan.h.d@swipnet.se> wrote:
> 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?

I, attached before/after screenshot to my initial e-mail, did you see
it? Or do you want to see the results of different code sample?

> Should the radiobuttons be grouped into two columns when the exceed
> some number, say 4 or 6 for example?

I don't know, since the upper limit on the amount of buttons is 9, and
9 radio-buttons in the same row looks fine to my taste, in my opinion
they shouldn't be, but then again that's the matter of personal taste.

>
> 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.

Well, the title is pretty much useless, since it doesn't provide any
information, and I did set the "skip-taskbar-hint" to TRUE, so it
shouldn't appear in the task bar. What icon bars are we talking about?
I used GEdit as some sort of reference implementation of how dialogs of
GNOME editors should look like, and it's dialogs don't have the title.
I don't mind returning it back, it would be  a trivial change after
all, it's just I'm not sure that I see the point.

>
> The use of default bold indicates screaming to me.

I thought that function was reserved for all caps :)

> It should not be default. A configure option is OK. Ditto font
> size larger. Not sure if this is a good default.

Well, again I tried to emulate GEdit, whose dialogs I find to be
easier on the eyes. And don't you think it would be too minor detail
to be worth a dedicated configure option. Shouldn't we just some sort
of a consensus and just use that settings?

>
> 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.

Didn't think of that one. Thanks, will fix that.

>
> 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.

Well, I guess there is more than one way to skin a cat, I'll rewrite
that portion of the code.

>
>
> +          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?

Because I need to set `menu_item_selection' to 0 otherwise if user
fiddles with radiobuttons and then presses cancel button for the code
in xmenu.c it would be indistinguishable from OK button being pressed.

>
> -  popup_activated_flag = 0;
>
> Do not remove this line. It is needed. Why are you removing it?

It is removed because otherwise one wouldn't be able to change
selected radio button more than once, since the first call to
`select_cb' would close the whole dialog.

At least for Gtk this code is redundant anyway, since the same
functionality could, and IMHO should, be achieved by chaining
`select_cb' and `deactivate_cb' for particular signal. Not sure if all
the other toolkits allow you to do such a thing.

Andrey Smirnov



  reply	other threads:[~2011-12-14  5:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-11 15:01 [PATCH] Change the look of dialogs created with `x-popup-dialog' Andrey Smirnov
2011-12-11 15:29 ` Lennart Borgman
2011-12-12 17:49   ` Stefan Monnier
2011-12-13  2:47     ` Andrey Smirnov
2011-12-13  2:54       ` Lennart Borgman
2011-12-12 17:44 ` Stefan Monnier
2011-12-13  7:07 ` Jan Djärv
2011-12-14  5:29   ` Andrey Smirnov [this message]
2011-12-14 20:41     ` Jan Djärv
2011-12-15  4:56       ` Andrey Smirnov
2011-12-16 13:42         ` Jan D.
2011-12-16 17:32           ` Andrey Smirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHQ1cqGXk+Kcp6F0sdHdrwMkm=ZkhASkUhsWs0r6eD-MhBbD3A@mail.gmail.com' \
    --to=andrew.smirnov@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=jan.h.d@swipnet.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.