mate-desktop / libmatekbd

Keyboard management library
https://mate-desktop.org
GNU Lesser General Public License v2.1
17 stars 11 forks source link

Flags are not scaled correctly #11

Open kalj opened 11 years ago

kalj commented 11 years ago

I enabled showing flags by

gsettings set org.mate.peripherals-keyboard-xkb.indicator show-flags true

and adding flags to ~/.icons/flags.

The flags appear and work as they should in all respects except one; the aspect ratio of the status icon in the panel is not correct. Instead of keeping the shape of the input image, it is stretched to span the entire space of the status icon. I believe this is a bug.

Btw, the icon showed at other places e.g. when unlocking the screen lock or in lightdm is correct, so this seams to be limited to libmatekbd-status.[ch].

Although I have absolutely no experience with gnome/gtk/gdk programming, I looked in the code to see if I could find anything. As far I understand, the flag image is loaded in libmatekbd-status.c:312:

image = gdk_pixbuf_new_from_file_at_size (image_filename,
                          globals.current_width,
                          globals.current_height,
                          &gerror);

Now, this should do the right thing and maintain the aspect ratio, at least according to the manual.

In my infinite ignorance, here is where I'm stuck. I would be happy very grateful for some hints and pointers on where to continue with this!

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/3040990-flags-are-not-scaled-correctly?utm_campaign=plugin&utm_content=tracker%2F1554631&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1554631&utm_medium=issues&utm_source=github).
kalj commented 11 years ago

Here is an image of the blocky flag:

flag

stefano-k commented 10 years ago

Can you paste the image you are using?

kalj commented 10 years ago

us

Sorry for the confusion here. I accidentally closed it. This is still relevant!

flexiondotorg commented 10 years ago

I can reproduce this using the icon set below:

The issue can be seen in the screenshot below:

The flags are rectanglular. The system try icon is made a square and therefore appears streached vertically. However, the flags in the Layout selector are not stretched. Flags are also correctly scale in the screen unlocker.

r-avital commented 10 years ago

Having the same issue; Just needed to add, if it helps, I definitely have seen this in MATE 1.6, and I'm seeing it again in MATE 1.8. MATE Panels version is 1.8.0.

Looking for a solution, can't find any so far.

kalj commented 8 years ago

Any solution in sight anytime soon?

kalj commented 7 years ago

I found a workaround which avoids the problem for now. Simply use flags that are square in shape and you're OK. In Linux Mint, the ones under /usr/share/linuxmint/mintlocale/flags/16/ are good.

Still it would be nice to find a real solution. I looked through the code again now, and from a quick glance I am not able to spot where things are being rescaled. Clearly, the Pixbuf should keep the right shape, but something else rescales it.

raveit65 commented 7 years ago

I added flags to mate-icon-theme and released 1.16.1 and 1.18.1. https://github.com/mate-desktop/mate-icon-theme/commit/9f6615a50d3e5482dcaa56fbc44d9a57047ca49e Flags are displayed out of box now in gtk3 and gt2 versions of MATE. As always tested on fedora-26/25/24.

vkotovv commented 7 years ago

@raveit65 Are you sure this one should be closed too? This issue is about scaling custom flags from ~/.icons/flags, and you added some flags in mate-icon-theme to be used by default. Thanks for adding flags and closing #18 though.

raveit65 commented 7 years ago

Better use svg flags in .icons/flags. It doesn't make a different where the folder is, svg flags scales perfect for me. Try the 'us flag' as svg.

raveit65 commented 7 years ago

Ok, New images are 4.3 but applet is a rectangle.

But is this really a problem? Is the world going down because of this? :-)

kalj commented 7 years ago

The world is not going down, but it does not show the specified image as it "should" look. That is indeed a bug, right? :) I imagine it should be fixable (I did try before but got unexpectedly shut down).

kalj commented 4 years ago

I just want to confirm that this is still an issue. When activating show-flags on a fresh install of ubuntu-mate 19.10, I see this:

image

That is not how the US flag looks like. It incorrectly reshapes the 3x4 image into 1x1.

I have not installed any additional flags, I believe the ones from /usr/share/icons/mate/scalable/animations/ (mate-icon-theme) are being used. Does this work as expected for anyone else?

kalj commented 4 years ago

It also looks bad next to all the other indicator icons which have a nice padding above and below:

image