LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-04-2014, 01:12 AM   #1
riteshjagga
LQ Newbie
 
Registered: Jul 2014
Posts: 2

Rep: Reputation: Disabled
How to style Browser's HTML Dropdown List using Linux GTK+ 2.0 themes


I have been exploring gtk+ themes present in /usr/share/themes to style up different components in applications.

I experimented on Crux theme by changing some properties in gtkrc file at this path /usr/share/themes/Crux/gtk-2.0.

Here are the changes that I made:
style "crux-menuitem-text-is-fg-color-workaround"
{
text[NORMAL] = @fg_color
text[PRELIGHT] = @selected_fg_color
text[SELECTED] = @selected_fg_color
text[ACTIVE] = @fg_color
text[INSENSITIVE] = darker (@bg_color)
xthickness = 14
ythickness = 14

}
widget "*.gtk-combobox-popup-menu.*" style "crux-menuitem-text-is-fg-color-workaround"


Added xthickness and ythickness to add space around every item in the dropdown list. Here *.gtk-combobox-popup-menu.* matches dropdown list that opens when a combobox is clicked/tocuhed.

This successfully matches dropdown lists in Windowed applications like Character Map, Power Management or any application containing a combobox and increases space. However, the same is not true for the HTML Select control's dropdown list that opens in an HTML page of a browser. It seems that the widget name doesn't match.

So is there a way to point to the dropdown list in an HTML page of a browser and style it up.

I know that styling of dropdown list is not possible using HTML-CSS so wanted to check at the OS level.

Please let me know if this is feasible using gtk+ themes and if not, which layer in OS should be modified to apply styles that goes inside the browser to style it up, any other alternate or even to say with reasoning that it is not possible at all.

Here is the output of "uname -a" command
Linux <mac address> 2.6.32-358.11.1.el6.x86_64 #1 SMP Tue Jun 11 17:23:30 CDT 2013 x86_64 x86_64 x86_64 GNU/Linux

Linux distribution is 64 bit and I think it is based on Fedora/Red Hat.

Last edited by riteshjagga; 07-04-2014 at 01:15 AM.
 
Old 07-04-2014, 02:14 AM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,198

Rep: Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307
It's not possible at all.
 
Old 07-05-2014, 04:08 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i would say it's up to the html rendering engine, e.g. webkitgtk or webkitgtk2. wich one is your browser compiled with? are you sure it's using gtk2 and not gtk3?
if it uses gtk2, you might be right about having modified the wrong widget.
but it could also be that the engine uses the gtk themes only in a very approximate manner, making changes as needed...

maybe with some modern browser you can give direct commands to the engine via CSS, like "webkit-dropdown-menu-margin: 14px;"? (i just made that up)
 
Old 07-08-2014, 05:51 AM   #4
riteshjagga
LQ Newbie
 
Registered: Jul 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you for the replies.

I am using two options to see the output of an HTML application.
1. Google Chrome
2. QT WebView - Ultimately this is required.

Both are webkit based but I am not sure of their connection with gtk.

I have tried with a number of browsers but the appearance of dropdown remains almost same except for some font styling which is inconsistent among them.

I don't think browsers provide any vendor specific command to increase the gap based on the observation that if Google Chrome - Webkit had been providing this command, Google for sure would have increased the gaps in many of its dropdown lists of Gmail settings to provide a very comfortable spacing for their end users.

In many such requirements, often projects are web based where developers are looking for consistent appearance across browsers and client machines and due to insufficient control over dropdown list, they have to adopt Javascript based equivalent dropdown lists. Ours is a machine specific software application and can explore if there are machine specific solutions too, if any.

Though this seems impossible but inquisitive to know that why different OS and browsers will not or cannot provide any mean to change this.
 
Old 07-08-2014, 11:52 AM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,198

Rep: Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307
Quote:
In many such requirements, often projects are web based where developers are looking for consistent appearance across browsers and client machines and due to insufficient control over dropdown list, they have to adopt Javascript based equivalent dropdown lists. Ours is a machine specific software application and can explore if there are machine specific solutions too, if any.
The best you can do is detect the client's OS and then serve up a "machine specific" stylesheet.

Dropdown lists in browsers are not GTK widgets.

Last edited by dugan; 07-08-2014 at 12:07 PM.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using Universal USB Installer - can I select U12.04.2 from their dropdown list if... RedBullion Linux - Newbie 1 08-31-2013 04:45 PM
Search result MYSQL using dropdown list koscek Programming 2 11-02-2007 06:42 AM
wine fonts small dropdown list invisible in STELLA bristi Linux - Software 1 06-22-2005 06:07 AM
Bootsplash Themes(need a list of websites to download themes from) ganja_guru Linux - General 1 09-26-2004 11:28 AM
where is majorcool list dropdown facility pudhiyavan Linux - Software 1 06-09-2004 03:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:23 PM.

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