LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-05-2018, 12:17 AM   #1
LenHoff
Member
 
Registered: Mar 2017
Posts: 61

Rep: Reputation: Disabled
change Mint Updater UI's description font color


I've looked all over for this one. In Mint 18.1, a mildly modified Mint-X-Aqua theme, the font for DESCRIPTIONS of updates & the incl. packages, are too close in color to the background & pretty small. I'd like to darken them & make slightly larger.

Also, the DESCRIPTION text color of selected updates doesn't switch to white, like the update names & versions do. I can take or leave the italics.

I found a line in /usr/lib/linuxmint/mintUpdate/mintUpdate.py, on line 1320, that I guessed might be related, as there isn't a lot of italic text. I edited the italic style out, but the updater wouldn't start after reboot - not even from manual launch.

self.buffer.create_tag("dimmed", scale=0.9, foreground="%s" % insensitive_color, style=Pango.Style.ITALIC)

Anyone know where the text color & size in those 2 places is controlled?
I assume the updater UI uses GTK-3?

Thanks.
Attached Thumbnails
Click image for larger version

Name:	mint-updater-small-font-2018-03-04 1.jpg
Views:	18
Size:	40.2 KB
ID:	27135  
 
Old 03-05-2018, 02:18 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,294

Rep: Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212
https://github.com/linuxmint/mintupdate I assume would be the source.

Two things going on I'd think.

One if it does properly work with themes and two if you can edit it to ignore the theme and force a setting.

Look at all that code and see if you can find answer maybe?
 
Old 03-06-2018, 01:59 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,809
Blog Entries: 9

Rep: Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637
i do not recommend to mess around with a very important system software, in a system folder (/usr).
it would be overwritten on updates anyhow.
you should go the proper way, and raise an issue. or first look at existing issues, maybe this is a known problem: https://github.com/linuxmint/mintupdate/issues

a workaround could be to force mintupdate to use a "better" theme (for the colours).
here's an example for firefox:
Quote:
Alternatively, force Firefox to use a light theme (e.g. "Adwaita:light"):

Copy /usr/share/applications/firefox.desktop to ~/.local/share/applications/firefox.desktop and replace all occurrences of Exec=firefox with Exec=env GTK_THEME=Adwaita:light firefox.
Close all running instances of Firefox and restart your window manager/desktop environment.
 
Old 03-07-2018, 09:40 PM   #4
LenHoff
Member
 
Registered: Mar 2017
Posts: 61

Original Poster
Rep: Reputation: Disabled
Thanks guys.
Mostly the colors used in MintUpdater's UI works like most Linux apps. MintUpdater uses the colors of the selected theme (background, foreground - (i.e., text & a few other objects), etc., defined in either gtk 2 or 3, which ever the app uses.

MintUpdater UI uses gtk-3, confirmed in "/usr/share/linuxmint/mintupdate/main.ui" - uses gtk-3.1.
At least some of the interface (positions, sizing - not theme colors) are specified in /usr/share/linuxmint/mintupdate/main.ui.

I found what controls the color of italicized descriptions located *just under* the package names.
I guessed a CSS value might be in gtk-3.0/gtk-main.css, where theme colors are defined. And guessed (on a hunch) the text might be "insensitive."(Text doesn't care about your feelings. Girl, you need to find a new man.)

In my screen shot, the color of italic "short description" text directly under the package names is controlled by a setting in /usr/share/themes/<theme name>/gtk-3.0/gtk-main.css.
If you modified a theme & placed it in your home directory, under ~/.themes (often suggested) & renamed, then gtk-main.css is in: ~/.themes/<theme name>/gtk-3.0/gtk-main.css. In Mint 18.1, the line is in section, /* Misc Colors */: "@define-color insensitive_fg_color shade(@theme_bg_color, 0.6);".

Temporarily, I changed it to "@define-color insensitive_fg_color @theme_text_color;" ("insensitive_fg_color" is defined in gtk-main.css), which made the short descriptions much darker & readable.

Using italics may be specified in either a mintUpdate.py file, where they use "style=Pango.Style.ITALIC, or elsewhere.
I haven't found if OR how the italic "textview_description" of "style=Pango.Style.ITALIC from mintUpdate.py can be overridden using CSS (e.g., in gtk-widgets.css).
I tried several

So it was using a lighter shade of the defined "insensitive_fg_color" - about 40% lighter than the background color. If you use a color picker & try to get a color value from something using the "shade" color option, you won't find that hex or RGB color code written down anywhere (I don't imagine). But sites like https://www.hexcolortool.com/ & others may be able to take a hex or RGB color & apply a % for a lighter / darker shade. Hexcolortool.com only allowed lightening / darkening a color by 20%, max.

The long descriptions text - under the Description tab, at bottom of the update UI was affected by a different gtk-3.0/gtk-widgets.css value.

/* Apply Effects to insensitive and Prelit Images */
*:insensitive {
-gtk-image-effect: dim;
}

That made the long descriptions "dimmer" (they're calling long descriptions "images").
Commenting out the whole entry made long descriptions much darker. Still, I see no reason for italics here.
Not sure why the stock Mint theme wanted insensitive images to be dim (and small) compared to nearby text. It might be easier to lighten the background color if contrast & readability are the only goals.

In gtk-widgets.css, I tried a number of "font-style" or "font-feature" values (set at normal, unset, etc.) for the 2 mentioned "insensitive" instances, but they didn't remove the italics.
 
Old 03-10-2018, 03:03 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,809
Blog Entries: 9

Rep: Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637
do i understand correctly that you effectively created a theme in ~/.themes that works better for you?
that would be a reasonable solution.
i would still notify the mint-updater devs about the problem.

Last edited by ondoho; 03-10-2018 at 03:05 AM.
 
Old 12-01-2018, 06:34 PM   #6
LenHoff
Member
 
Registered: Mar 2017
Posts: 61

Original Poster
Rep: Reputation: Disabled
Yes, I have a custom theme in ~/.themes. I looked at several themes - included in Mint distro & custom ones. None improved mintUpdate's descriptions text readability - for me.

It took a long time to revisit the font size, style & color for the package descriptions in Mint Update UI.
No, I'd rather not have had to mess with code in the main Update file, but the size & color of descriptions - especially in italics is just too hard for me.

In Mint 18.1, the main file for the updater is: /usr/lib/linuxmint/mintUpdate/mintUpdate.py

AFAIK, by modifying the custom theme being used (Cinnamox Heather - put in ~/.themes) I could only change the update package description text's color & size in the UPPER pane of Update UI. I could only figure out how to change the lower pane's description text by modifying mintUpdate.py.
Maybe someone else know how to do it in a theme, but no one volunteered.

As mentioned, it was under a section of the theme (Cinnamox) in Gtk3 - gtk.css, labeled Hyperlinks (no idea why, because package descriptions aren't links).

The code that changed descriptions in upper pane was:
Code:
  *:insensitive, *:insensitive:insensitive {
    color: #000000;  
    font-size: 10pt;
I changed text to black & added the "font-size" line, which seemed to work (for the upper pane).

To change the lower pane descriptions (which was really small & italic), as a guess I searched mintUpdate.py for "italic," - found only one line.
In Mint 18.1, the main file is: /usr/lib/linuxmint/mintUpdate/mintUpdate.py

It used the Pango text layout / rendering? library for the lower pane descriptions (best I could tell). Don't know about the upper pane. If they used Pango for one small section, not sure why.

To this non-professional, Pango appears to be something like we might've used in the 80's to set up print output, etc. IOW (IMHO), it's not user friendly or particularly easy or fast.

The lines that controlled description text in mintUpdate's lower pane were in a section, starting w/ the line:
Code:
self.buffer = self.builder.get_object("textview_description").get_buffer()
            context = self.builder.get_object("textview_description").get_style_context()
            insensitive_color = context.get_color(Gtk.StateFlags.INSENSITIVE)
            insensitive_color = "#{0:02x}{1:02x}{2:02x}".format(int(insensitive_color.red  * 255), int(insensitive_color.green * 255), int(insensitive_color.blue * 255)) 
            self.buffer.create_tag("dimmed", scale=1.0, foreground="%s" % insensitive_color, style=Pango.Style.NORMAL)
Original values were: "style=Pango.Style.ITALIC)" & "scale=0.9,"
Changing them to Style.NORMAL, and increasing "scale=1.0" made it much more readable.

No, I'd rather not have had to mess with code in the main Update file, but the descriptions size - and italics are just too hard for me.



I made notes of what needed to be changed, if I have to do it again after an update. Maybe I'll drop the developers a line.
 
  


Reply

Tags
color, font, mint


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mint 18 xfce clock font color change to white eddystone54 Linux - Desktop 1 11-29-2016 06:52 AM
How to change font color and font size in terminal ? wlaw Linux - Newbie 3 05-15-2007 09:57 PM
change the font color Drunkalot Linux - General 2 08-09-2005 11:37 PM
change the console font color minike Slackware 3 08-30-2004 06:11 PM
change font color...no NOT in X centr0 Slackware 4 05-01-2003 04:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration