Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Look and Chameleon Technology » A little theming
A little theming [message #18450] Wed, 01 October 2008 19:23 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
Here is a little theme that I would like to incorporate in my applications: Skulpture. I've already asked permission from the author.

One side effect of this will probably be a theming engine for U++. Ans thanks to Chamaelon, that theming engine is 95% done Very Happy.

I hope I'll have something to show by weekend (screenshots and maybe some comments on flexibility of Chameleon)
Re: A little theming [message #18452 is a reply to message #18450] Wed, 01 October 2008 21:58 Go to previous messageGo to next message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
Very cool. I'll definitely be using it. I know it is good UI design to maintain the system theme, but after using Gnome+Compiz, Windows XP is just ugly!
Re: A little theming [message #18459 is a reply to message #18450] Thu, 02 October 2008 06:34 Go to previous messageGo to next message
yoco is currently offline  yoco
Messages: 25
Registered: June 2006
Location: Taiwan
Promising Member
Expecting ^^
Re: A little theming [message #18489 is a reply to message #18459] Fri, 03 October 2008 17:06 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
I managed to skin Button together with it's default style, and I must say that it looks as good on Windows as it did under Linux! Heck, Iíll use this as a default theme for NOGTK apps. No offense to Windows 95, but their widgets look butt ugly when next to a Gtk+ or KDE4 app. And option to change theme under Windows will forever populate my Options dialog.

But the initial quick start was halted when I discovered that Option, Switch and LabelBox have no direct retrievable style. Obtaining the style from an Option would give a Button style. I checked out the Paint methods, and the skinning is dome by determining which image to show from and image list.

So basically I have to override the content of the image list to make it work. I could do this, but I would rather have all controls to own their style.

If Mirek is OK with it, I can add Style structures similar to the one in Button to all the controls that need skinning, and also refactor the Paint methods. Iíll be waiting for the reply on that before I skin additional widgets.
Re: A little theming [message #18490 is a reply to message #18489] Fri, 03 October 2008 17:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12022
Registered: November 2005
Ultimate Member
You can alter the appearance of Option/Switch by directly manipulating CtrlImg.

See static chCtrlsImg sImgs[] in ChWin32.cpp.

This solution is perhaps a little bit non-uniform, but IMO sufficient...

I am looking forward to the second addition to "art" folder Smile

Mirek
Re: A little theming [message #18491 is a reply to message #18490] Fri, 03 October 2008 18:11 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
luzr wrote on Fri, 03 October 2008 18:30

You can alter the appearance of Option/Switch by directly manipulating CtrlImg.

See static chCtrlsImg sImgs[] in ChWin32.cpp.

This solution is perhaps a little bit non-uniform, but IMO sufficient...

I am looking forward to the second addition to "art" folder Smile

Mirek


Ok, I'll go along because getting the theme done is more important (and easy) than convincing you that current solution is rather ugly.

I used CtrlsImg directly because there is no way to access that static chCtrlsImg array from the outside and I don't want Windows specific solution.

I attached a preview screenshot with the dark gray color style of the Skulpture theme:
index.php?t=getfile&id=1409&private=0


As you can see, the LabelBox is not skinned yet, because it uses manual line drawing for it's look. What solution would you prefer to enable skinning for this widget?

  • Attachment: test.PNG
    (Size: 9.04KB, Downloaded 1634 times)
Re: A little theming [message #18492 is a reply to message #18491] Fri, 03 October 2008 19:35 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1354
Registered: November 2005
Location: Poland
Senior Contributor

Looks very nice! I'm trying something similar for kde's oxygen theme. I've found equivalent for gnome http://kims-area.com/?q=node/63
Re: A little theming [message #18493 is a reply to message #18491] Fri, 03 October 2008 19:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12022
Registered: November 2005
Ultimate Member
cbpporter wrote on Fri, 03 October 2008 12:11


I used CtrlsImg directly because there is no way to access that static chCtrlsImg array from the outside and I don't want Windows specific solution.



Ops, of course. I have posted it just as example of altering Option/Switch!

You ARE supposed to use CtrlsImg directly.

Quote:


As you can see, the LabelBox is not skinned yet, because it uses manual line drawing for it's look. What solution would you prefer to enable skinning for this widget?



If I would have known, I would have done it already Smile

So far, it looks quite acceptable to provide just those predefined styles there and color...

Mirek
Re: A little theming [message #18515 is a reply to message #18493] Mon, 06 October 2008 08:44 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
I did a little color theme change because the previous one was a little too dark and too gray. This one is more lively I think. I attached a small sample, only with two widgets (the rest are yet to be ported to the new color scheme).

I have a small question: when I use tab to cycle through the widgets in the window, the style for buttons gets overridden with the default Windows style for focused buttons, with a little dotted frame and Windows skin. How can I change that?

edit: deleted old exe

[Updated on: Sat, 11 October 2008 19:24]

Report message to a moderator

Re: A little theming [message #18516 is a reply to message #18515] Mon, 06 October 2008 09:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12022
Registered: November 2005
Ultimate Member
Well, now this is really interesting. I have no clue. I wish I could see the code.

Mirek

[Updated on: Mon, 06 October 2008 09:03]

Report message to a moderator

Re: A little theming [message #18519 is a reply to message #18516] Mon, 06 October 2008 09:54 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
Here is a small testcase.

Edit: removed exe, see newer posts.

[Updated on: Mon, 06 October 2008 18:31]

Report message to a moderator

Re: A little theming [message #18520 is a reply to message #18519] Mon, 06 October 2008 11:04 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
Hint: it seems that the style from StyleOK is used to draw the focused buttons.

Another issue: if I call Set(0, true) on a single item Switch, the item is not selected. If I call Set(0, true, “text”), then the item is selected.
Re: A little theming [message #18521 is a reply to message #18520] Mon, 06 October 2008 18:31 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
So here is the next preview. It is starting to really shape up.

Disabled scrollbars are a little bit ugly because I can't get the desired effect with hotspots yet. Also, it would be nice if the Style could specify if a disabled scrollbar shows it's thumb or not.

DropList skin is not complete.

EditFields have some problem with their border, because I can't figure out yet how to resize it. I need to define border sizes through chameleon.

And DocEdit uses yet another style of code to draw it's border, so I'm no where near as to touching it's style. But the scrollbar inside works with new skin.

Also, modifying Button::StyleScroll does not affect any scrollbars. Am I correct in assuming that I need to initialize it with the ScrollBar style?

Another question: what are ScrollBar::Style.left2, up2, etc. used for? I only modified the fields that don't end in 2.

Edit: removed old exe.

[Updated on: Thu, 16 October 2008 22:46]

Report message to a moderator

Re: A little theming [message #18600 is a reply to message #18521] Sat, 11 October 2008 08:22 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12022
Registered: November 2005
Ultimate Member
Note: we have only about 1GB for the forum now. Please at least delete previous versions Smile

Mirek
Re: A little theming [message #18601 is a reply to message #18519] Sat, 11 October 2008 08:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12022
Registered: November 2005
Ultimate Member
cbpporter wrote on Mon, 06 October 2008 03:54

Here is a small testcase.



Well, I would need testcase (and after all, the whole thing too Smile in source form...

Mirek
Re: A little theming [message #18602 is a reply to message #18521] Sat, 11 October 2008 08:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12022
Registered: November 2005
Ultimate Member
cbpporter wrote on Mon, 06 October 2008 12:31

So here is the next preview. It is starting to really shape up.

Disabled scrollbars are a little bit ugly because I can't get the desired effect with hotspots yet. Also, it would be nice if the Style could specify if a disabled scrollbar shows it's thumb or not.

DropList skin is not complete.

EditFields have some problem with their border, because I can't figure out yet how to resize it. I need to define border sizes through chameleon.



I cannot help without seeing the code Smile

Quote:


Also, modifying Button::StyleScroll does not affect any scrollbars. Am I correct in assuming that I need to initialize it with the ScrollBar style?



StyleScroll is now deprecated. It was used to paint scrollbar buttons, which was enough for XP, but not for Linux themes.

Quote:


Another question: what are ScrollBar::Style.left2, up2, etc. used for? I only modified the fields that don't end in 2.



Some GTK themes have secondary buttons (usually two up buttons, second one close to down button).

You can activate them using 'isup2' etc...

Mirek

P.S.: I hope you could write some T++ about theming when you are finished Smile

Re: A little theming [message #18607 is a reply to message #18602] Sat, 11 October 2008 19:46 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
luzr wrote on Sat, 11 October 2008 09:29

cbpporter wrote on Mon, 06 October 2008 12:31

So here is the next preview. It is starting to really shape up.

Disabled scrollbars are a little bit ugly because I can't get the desired effect with hotspots yet. Also, it would be nice if the Style could specify if a disabled scrollbar shows it's thumb or not.

DropList skin is not complete.

EditFields have some problem with their border, because I can't figure out yet how to resize it. I need to define border sizes through chameleon.



I cannot help without seeing the code Smile


Hmmm, I thought that I posted a test case with source. Guess I forgot. Sorry. Anyway, wait a little (I still need some days) and I'll post something working so that everybody can start using it. Just need to iron out some details first. My approach is to have a ChameleonTheme class which can load the theming info from disk. It does the streaming itself for each Style class for now, but in the future I hope we can move streaming to each style. Also, the theme can be embedded in the exe with binary inclusion mechanism if external file is not desired. Another advantage is that we can keep multiple themes in memory, and mix and match.

Those comments about what is wrong with the theme right now where more given as information for people downloading the exe and see something wrong or ugly, not to ask help.

Except for the EditField question. I think that can be answered without seeing any of my code, because I havenít done anything to it: how can I change the border size of EditFields through Chameleon (not sure if possible right now). And except setting thumb visibility for disabled ScrollBars.

Quote:


StyleScroll is now deprecated. It was used to paint scrollbar buttons, which was enough for XP, but not for Linux themes.


OK, I'll initialize it with ScrollBar style to keep some compatibility.

Quote:


You can activate them using 'isup2' etc...


Great, I always wanted that second down button under Windows!

Quote:


P.S.: I hope you could write some T++ about theming when you are finished Smile


Sure, that shouldnít be a problem. By the time I finish this theme, I'm sure to have the knowledge for that Razz. But there are some areas which should be improved before documenting, but we'll get to that later.
Re: A little theming [message #18608 is a reply to message #18600] Sat, 11 October 2008 19:48 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1391
Registered: September 2007
Senior Contributor
luzr wrote on Sat, 11 October 2008 09:22

Note: we have only about 1GB for the forum now. Please at least delete previous versions Smile

Mirek

If anything is left from the money, maybe you should consider buying another 512 MiB:). I will try to delete large attachments if they are no longer needed.
Re: A little theming [message #18609 is a reply to message #18607] Sat, 11 October 2008 20:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12022
Registered: November 2005
Ultimate Member
cbpporter wrote on Sat, 11 October 2008 13:46


Except for the EditField question. I think that can be answered without seeing any of my code, because I havenít done anything to it: how can I change the border size of EditFields through Chameleon (not sure if possible right now).



Via EditField::Style::edge the margin is defined in

void ActiveEdgeFrame::FrameAddSize(Size& sz);
void ActiveEdgeFrame::FrameLayout(Rect& r)

based on ChFrame. I am not sure what are you using to define edge Value, but if Image, it is simply defined by hotspots.

Mirek
Re: A little theming [message #18613 is a reply to message #18609] Sat, 11 October 2008 23:48 Go to previous messageGo to previous message
TeCNoYoTTa is currently offline  TeCNoYoTTa
Messages: 138
Registered: July 2008
Location: Egypt
Experienced Member

can u please put the code ??
Previous Topic: The problem with the operation of the buffer.
Next Topic: Set fields side to other fields and fields width to text width
Goto Forum:
  


Current Time: Mon Sep 23 01:11:20 CEST 2019

Total time taken to generate the page: 0.05374 seconds