docjones Posted December 22, 2016 Posted December 22, 2016 Hi I can change the Theme when main module is created, but, if i try change the theme after user login (in Tuniloginform) then not works. I want that diferent users have diferent theme , but it's not possible if only can apply the theme in onmainmodulecreate. there are any way to do this ? thanks. Quote
mhmda Posted December 22, 2016 Posted December 22, 2016 You must reload your app. The theme is based in several files (css...) and in order load all of them you must reload you app (it's web not desktop). Quote
wprins Posted December 22, 2016 Posted December 22, 2016 Not sure if this is 100% what you want, but: Set MainModule.RecallLastTheme property to True, and then assign to MainModule.Theme at runtime when you want to change the theme. The user will have to log in again of course, but then the login form (and everything else) should come back with the new theme and will stay so until changed again. See also the AllFeatures\mdemo.dpr project which demonstrates the above, setting the theme with combobox. Quote
docjones Posted December 22, 2016 Author Posted December 22, 2016 I know, but i don't want all users have same theme. I want change theme after user logged, becouse is when i know who is logged and which is the prefered user-theme (every user can have a diferent prefered theme). then, it's not possible that diferent users have diferent themes...., becouse when user login i must reload the app to apply the user-theme, and then user must be loggeed again. Quote
wprins Posted December 22, 2016 Posted December 22, 2016 I know, but i don't want all users have same theme. I want change theme after user logged, becouse is when i know who is logged and which is the prefered user-theme (every user can have a diferent prefered theme). then, it's not possible that diferent users have diferent themes...., becouse when user login i must reload the app to apply the user-theme, and then user must be loggeed again. That's not correct. The theme is per browser, effectively, so as long as users are on different browsers then they can have different themes. There's some feature (a cookie I assume) that ensures that the browser remembers its theme. So different users can certainly have different themes as long as they're not all on the same browser/pc, which presumably they're not going to be... Quote
docjones Posted December 22, 2016 Author Posted December 22, 2016 thx, using cookies to store user theme preference it's a good solution, and only need to reload app if diferent user with diferent theme do login on same browser. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.