New user registration is currently disabled due to spam abuse / Регистрация новых пользователей в настоящее время приостановлена из-за злоупотреблений спаммерами

article-style.css mods: font size per group. box doted line

General discussion

article-style.css mods: font size per group. box doted line

Postby goldenaddict » Sat Nov 05, 2011 4:18 am

- http://goldendict.org/wiki/index.php/FAQ shows how to change the style according to the language we are translating to or from... how to do the same thing but for a given group?
e.g.
Code: Select all
MainWindow #body[currentGroup="Bengali"]


- Using black background makes the dictionary title box doted line to disappear. Can we change the color of this doted line?

Cheers
goldenaddict
 
Posts: 6
Joined: Mon Oct 10, 2011 11:36 pm

Re: article-style.css mods: font size per group. box doted l

Postby chulai » Sat Nov 05, 2011 1:13 pm

It's standard CSS rules. So, you can use something like this:

Code: Select all
/* Dictionary's name heading */
.gddictname
{
  border: 1px solid #C6CED3; padding: 0.5em; padding-left: 0.5em;
  margin-top: 1.2em; margin-bottom: 0.1em; font-weight: bold; font-size: 11px;
  background: #FFFEF2;
}


Change #C6CED3 with the color you want to use for the dotted border. Either use the RGB hexa code or standard name colors like "red", "blue" and so on.

If you want to apply the style only for a specific group you can try changing .gddictname to #body[currentGroup="Bengali"] .gddictname

Good Luck!

goldenaddict wrote:- http://goldendict.org/wiki/index.php/FAQ shows how to change the style according to the language we are translating to or from... how to do the same thing but for a given group?
e.g.
Code: Select all
MainWindow #body[currentGroup="Bengali"]


- Using black background makes the dictionary title box doted line to disappear. Can we change the color of this doted line?

Cheers
chulai
 
Posts: 464
Joined: Sat Jan 08, 2011 10:11 pm

Re: article-style.css mods: font size per group. box doted l

Postby goldenaddict » Sat Nov 05, 2011 5:46 pm

Thanks chulai.

I found that .gddictname trick saving an article to html and then opening it with a text editor.
It works great.

I tried your suggestion for applying article changes only to one group (in the example: "Bengali"). It did not work, and I can't find "currentGroup" in the html.
goldenaddict
 
Posts: 6
Joined: Mon Oct 10, 2011 11:36 pm

Re: article-style.css mods: font size per group. box doted l

Postby chulai » Sat Nov 05, 2011 10:54 pm

I took a look at the code. Using "currentGroup" is not going to work to style the dictionaries's results. That's because the results are a webpage with iframes that uses the style article-style.css. whereas qt-style.css is used to theme (or style) the UI components, such as the the searchPane, the translateLine and the wordList fields.

For example, I style the translate line and word lists for the "en" group by adding the following CSS to qt-style.css:

Code: Select all
MainWindow #searchPane #translateLine[currentGroup="en"], MainWindow #searchPane #wordList[currentGroup="en"]
{
  background: red;
  color: black;
  font-size: 20px;
}

style-en-group.JPG
Custom UI style for "en" group
style-en-group.JPG (40.05 KiB) Viewed 15019 times


style-es-group.JPG
Default style
style-es-group.JPG (19.55 KiB) Viewed 15019 times


goldenaddict wrote:Thanks chulai.

I found that .gddictname trick saving an article to html and then opening it with a text editor.
It works great.

I tried your suggestion for applying article changes only to one group (in the example: "Bengali"). It did not work, and I can't find "currentGroup" in the html.
chulai
 
Posts: 464
Joined: Sat Jan 08, 2011 10:11 pm

Re: article-style.css mods: font size per group. box doted l

Postby goldenaddict » Sun Nov 06, 2011 2:02 am

Thanks for your help.

So, it seems that there is no way to change settings by group.

The reason I need this is because most of my dictionaries do not have correct language tags.
In dsl dictionaries it is pretty simple to edit these tags (#INDEX_LANGUAGE "somelanguage" #CONTENTS_LANGUAGE "anotherlanguage")...
but I still have not found where this tags are in stardict dictionaries and in bgl files things are worse because one needs to unpack the file, edit it and pack it back, which i dont think will be a transparent process.
goldenaddict
 
Posts: 6
Joined: Mon Oct 10, 2011 11:36 pm


Return to General

Who is online

Users browsing this forum: Google [Bot] and 23 guests