Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flags are not scaled correctly #11

Open
kalj opened this issue Aug 31, 2013 · 14 comments
Open

Flags are not scaled correctly #11

kalj opened this issue Aug 31, 2013 · 14 comments

Comments

@kalj
Copy link

kalj commented Aug 31, 2013

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! We accept bounties via Bountysource.

@kalj
Copy link
Author

kalj commented Aug 31, 2013

Here is an image of the blocky flag:

flag

@stefano-k
Copy link
Collaborator

Can you paste the image you are using?

@kalj kalj closed this as completed Nov 9, 2013
@kalj kalj reopened this Dec 3, 2013
@kalj
Copy link
Author

kalj commented Dec 3, 2013

us

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

@flexiondotorg
Copy link
Member

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
Copy link

r-avital commented Jul 9, 2014

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
Copy link
Author

kalj commented Mar 25, 2016

Any solution in sight anytime soon?

@kalj
Copy link
Author

kalj commented Dec 1, 2016

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
Copy link
Member

raveit65 commented Apr 3, 2017

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

@raveit65 raveit65 closed this as completed Apr 3, 2017
@vkotovv
Copy link

vkotovv commented Apr 3, 2017

@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
Copy link
Member

raveit65 commented Apr 3, 2017

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
Copy link
Member

raveit65 commented Apr 3, 2017

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? :-)

@raveit65 raveit65 reopened this Apr 3, 2017
@kalj
Copy link
Author

kalj commented Apr 3, 2017

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
Copy link
Author

kalj commented Feb 20, 2020

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
Copy link
Author

kalj commented Feb 20, 2020

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

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants