Using CSS properties?

Post Reply
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Using CSS properties?

Post by Nyyrazzilyss »

I'm trying to figure out how to use CSS properties with echo.

In particular, the intent is I have a lot of pre-rendered .png files i'm using for buttons. I would like to change them to all be generated realtime from a table.

A sample button:


This is using the AvQest font, I was able to make it work by copying it into the fonts folder.

label:echo([[<p style="font-size:20px;font-style:bold;font-family: 'AvQest'"><b><center><font color="red">XXX</font></center></b></p>]])

works to print 'XXX' to a label at 20px in bold with that font. What i'm trying to do now is add the 'text-shadow' property ( ... shadow.asp ) to it - No luck there. I'm guessing i'm not formatting the :echo properly?

label:echo([[<h1 "text-shadow: 2px 2px #FF0000"><p style="font-size:20px;font-style:bold;font-family: 'AvQest'"><b><center><font color="black">XXX</font></center></b></p></h1>]])

Doesn't work - The letters display in black, but the shadow isn't applied. Suggestions?


I tried using the buttons option to build a button/the stylesheet that way.

color: white; background-color: red;
font-size: 40px;
padding: 6px;
border-radius: 5px;

(all worked)

Neither box-shadow or text-shadow properties had any effect though.


I found a post from 2010 that indicated there was no support at that time for text shadows.
I'm guessing that's still the case?


Reading through the thread, it's what Qt currently supports in stylesheets that's usable that doesn't currently support it :(

User avatar
Posts: 4901
Joined: Sat Mar 14, 2009 3:13 pm

Re: Using CSS properties?

Post by Vadi »

Yep, I think you found the answer.

User avatar
Posts: 986
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Using CSS properties?

Post by SlySven »

From what I remember when I was playing with toolbars/menus/buttons you do have to consider the order of declaring the styles when you start using pseudo-states and sub-controls like, say :hover or :selected otherwise one will override another but in not the way you want - I do not recall the details precisely though. :(

Post Reply