#1 2016-02-14 16:37:17

datadon
Member
Registered: 2015-04-23
Posts: 108

Changing Themes

I copied an app to a new location.  changed the icon, and the name of the app and Title etc.  No issues there.

However when I try to change the theme from Slate to Sandstone it does not change.  I have done a new build and debug but always see the old slate.  Anything I am missing in this process?

As time allows....

Don

Offline

#2 2016-02-14 18:25:20

edunt
Member
Registered: 2015-12-21
Posts: 258

Re: Changing Themes

datadon wrote:

I copied an app to a new location.  changed the icon, and the name of the app and Title etc.  No issues there.

However when I try to change the theme from Slate to Sandstone it does not change.  I have done a new build and debug but always see the old slate.  Anything I am missing in this process?

As time allows....

Don

Delete your _Complied folder and save and rebuild your app.

Offline

#3 2016-02-14 21:54:38

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Changing Themes

Hello Donald,

The edunt suggestion can work, you know, sometimes, for certain changes, it's good to try by deleting the "_Compiled" folder. Anyway, here is some tips about the app's themes. First of all, take a look at samples like the "Calculator" one, which uses themes.

Secondly, remember we can choose a theme to be used by default. And also, we need to specify what themes we wanted to include in our application in order to be available, that is, in order to allow us to switch to one of the availables themes.

The above image shows the "Default" theme. In this case we use the "Default", but we can choose one of the available themes to be the default one in the application, that is, the theme in which the application starts:

d7iPtX8.png

The above image shows the available themes. That is, we can choose from the list one or commonly more than one theme in order to be available to be set or "switched" at runtime using the SetAppTheme action.

VXt5OPM.png

Once you choose the included themes, you can switch to one of them at runtime. However, the theme change do not implied the application start with that theme. If you want to do that, you must to save the theme when set it (using the SetOption action, for example). Then, in the app "Ready" event you can retrieve such option (the theme name) and use again the "SetAppTheme" action to establish your application theme.

If you follow this steps and anyway you get stucked, please, Donald, post here and I will try to help you as quickly as possible.

Offline

#4 2016-02-15 00:58:25

datadon
Member
Registered: 2015-04-23
Posts: 108

Re: Changing Themes

Thanks for the feedback from both ya'll. 

Here is what I discovered.  If you have a background  color specified on any view (in my case 4th view) it will dominate the rest of the app.  The text and other attributes change as required but the color gets overwritten,   

What say you?

Offline

#5 2016-02-15 01:15:37

datadon
Member
Registered: 2015-04-23
Posts: 108

Re: Changing Themes

How would I use code like this to set the style to orange

.jumbotron { 
    background-color: #f4511e; /* Orange */
    color: #ffffff;
}

Last edited by datadon (2016-02-15 02:14:52)

Offline

#6 2016-02-15 10:33:39

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Changing Themes

Hello to all,

datadon wrote:

Thanks for the feedback from both ya'll. 

Here is what I discovered.  If you have a background  color specified on any view (in my case 4th view) it will dominate the rest of the app.  The text and other attributes change as required but the color gets overwritten,   

What say you?

In fact if we use the object inspector to establish the "background-color" (or any other CSS rule) of an app's view, they are only applied to that view. Probably what happend is you change to the "View4", but, don't select it (maybe I can improve this in the near future) so you set the "background-color" of the app itself, and then, yes, this "background-color" dominates all the views, because the "C" of "CSS", which means "Cascading".

Offline

#7 2016-02-15 10:39:21

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: Changing Themes

Hello,

datadon wrote:

How would I use code like this to set the style to orange

.jumbotron { 
    background-color: #f4511e; /* Orange */
    color: #ffffff;
}

What the above CSS code means is "apply these 'background-color' and 'color' CSS rules to all elements with the class ".jumbotron". If you put that code in the "Inline CSS" app's option or in one CSS file added to the app too, then, yes, all elements with the class "jumbotron" change their apparence to the specified style.

But since in this thread we start to talking about app's themes, then maybe we have some mistake here. In order to switch to another app's theme we must use the "SetAppTheme" action (once we include the themes we wanted using the the app's options dialog), but we can't change the app's theme using CSS code.

We can modify the current theme using CSS. All the CSS rules we define in the app's "Inline CSS" option or an external CSS file are applied to the current app's theme.

Hope this can help you in some way Donald, but please, post below whatever other questions you have.

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.