All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 5/6] gtk: add support for screen scaling and	full screen
Date: Sat, 25 Feb 2012 16:49:08 +0100	[thread overview]
Message-ID: <4F4902F4.7030909@weilnetz.de> (raw)
In-Reply-To: <1329695104-15174-6-git-send-email-aliguori@us.ibm.com>

Am 20.02.2012 00:45, schrieb Anthony Liguori:
> Basic menu items to enter full screen mode and zoom in/out. Unlike SDL, we
> don't allow arbitrary scaling based on window resizing. The current 
> behavior
> with SDL causes a lot of problems for me.
>
> Sometimes I accidentally resize the window a tiny bit while trying to 
> move it
> (Ubuntu's 1-pixel window decorations don't help here). After that, 
> scaling is
> now active and if the screen changes size again, badness ensues since the
> aspect ratio is skewed.
>
> Allowing zooming by 25% in and out should cover most use cases. We can 
> add a
> more flexible scaling later but for now, I think this is a more friendly
> behavior.
>
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> ---
> ui/gtk.c | 89 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
> 1 files changed, 85 insertions(+), 4 deletions(-)
>
> diff --git a/ui/gtk.c b/ui/gtk.c
> index 73051db..b9a9bc3 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
[...]
> + s->zoom_in_item = 
> gtk_image_menu_item_new_from_stock(GTK_STOCK_ZOOM_IN, NULL);
> + gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->zoom_in_item),
> + "<QEMU>/View/Zoom In");
> + gtk_accel_map_add_entry("<QEMU>/View/Zoom In", GDK_KEY_equal, 
> GDK_CONTROL_MASK | GDK_MOD1_MASK);
> + gtk_menu_append(GTK_MENU(s->view_menu), s->zoom_in_item);
> +
> + s->zoom_out_item = 
> gtk_image_menu_item_new_from_stock(GTK_STOCK_ZOOM_OUT, NULL);
> + gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->zoom_out_item),
> + "<QEMU>/View/Zoom Out");
> + gtk_accel_map_add_entry("<QEMU>/View/Zoom Out", GDK_KEY_minus, 
> GDK_CONTROL_MASK | GDK_MOD1_MASK);
> + gtk_menu_append(GTK_MENU(s->view_menu), s->zoom_out_item);
> +
> separator = gtk_separator_menu_item_new();
> gtk_menu_append(GTK_MENU(s->view_menu), separator);

I think GDK_KEY_plus would be a better choice instead of GDK_KEY_equal
because that's the key used to zoom in by GNOME terminal, most web browsers
and many more programs.

Usually there is also a "Zoom 100 %" with GDK_KEY_0 which resets
zooming to 100 %.

Regards,

Stefan Weil

  parent reply	other threads:[~2012-02-25 15:49 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-19 23:44 [Qemu-devel] [PATCH 0/6] Add GTK UI to enable basic accessibility Anthony Liguori
2012-02-19 23:44 ` [Qemu-devel] [PATCH 1/6] console: allow VCs to be overridden by UI Anthony Liguori
2012-02-20  9:17   ` Gerd Hoffmann
2012-02-20 13:45     ` Anthony Liguori
2012-02-20 13:59       ` Gerd Hoffmann
2012-02-20 14:11         ` Anthony Liguori
2012-02-20 14:27           ` Gerd Hoffmann
2012-02-20 15:10             ` Anthony Liguori
2012-02-19 23:45 ` [Qemu-devel] [PATCH 2/6] ui: add basic GTK gui Anthony Liguori
2012-02-20 20:45   ` Stefan Weil
2012-02-21  0:20     ` Anthony Liguori
2012-02-19 23:45 ` [Qemu-devel] [PATCH 3/6] gtk: add virtual console support Anthony Liguori
2012-02-20 21:13   ` Stefan Weil
2012-02-25 16:21   ` Stefan Weil
2012-02-25 19:49     ` Anthony Liguori
2012-02-25 20:22       ` Stefan Weil
2012-02-25 21:18         ` Anthony Liguori
2012-02-19 23:45 ` [Qemu-devel] [PATCH 4/6] gtk: add support for input grabbing Anthony Liguori
2012-02-20  0:09   ` Anthony Liguori
2012-02-19 23:45 ` [Qemu-devel] [PATCH 5/6] gtk: add support for screen scaling and full screen Anthony Liguori
2012-02-20  7:41   ` Paolo Bonzini
2012-02-20 13:45     ` Anthony Liguori
2012-02-25 15:49   ` Stefan Weil [this message]
2012-02-19 23:45 ` [Qemu-devel] [PATCH 6/6] gtk: make default UI Anthony Liguori
2012-02-20  0:15   ` Roy Tam
2012-02-20  1:10     ` Anthony Liguori
2012-02-20  1:50       ` Roy Tam
2012-02-20  2:22         ` Anthony Liguori
2012-02-20  2:24       ` Brad Smith
2012-02-20  2:44         ` Anthony Liguori
2012-02-20  2:50           ` Roy Tam
2012-02-20  2:52           ` Brad Smith
2012-02-20  3:04             ` Anthony Liguori
2012-02-20 14:06               ` Stefano Stabellini
2012-02-20 14:07                 ` Anthony Liguori
2012-02-20 14:44                   ` Stefano Stabellini
2012-02-20 14:46                     ` Roy Tam
2012-02-19 23:59 ` [Qemu-devel] [PATCH 0/6] Add GTK UI to enable basic accessibility Anthony Liguori
2012-02-20 12:17 ` Kevin Wolf
2012-02-20 12:47   ` Kevin Wolf
2012-02-20 14:08     ` Anthony Liguori
2012-02-20 14:04   ` Anthony Liguori
2012-02-20 14:33     ` Kevin Wolf
2012-02-25 17:02 ` Stefan Weil
2012-02-25 20:11   ` Anthony Liguori
2012-02-25 21:15     ` Stefan Weil
2012-02-25 21:47       ` [Qemu-devel] Very small VGA window sizes (was: Re: [PATCH 0/6] Add GTK UI to enable basic accessibility) Stefan Weil

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=4F4902F4.7030909@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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.
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.