Well, I can seemingly easily switch between qx.theme.Classic and
qx.theme.Modern (for example), but not my app's own theme.  I created a
timer that fires every second and changes some stuff while I'm testing,
and during this, every 3 seconds it switches between themes:

if ((counter / 3) % 2) {
  qx.theme.manager.Meta.getInstance().setTheme(qx.theme.Classic);
} else {
  qx.theme.manager.Meta.getInstance().setTheme(qx.theme.Modern);
}

(It's probably worth mentioning that TabView tabs don't get redrawn
until I hover them, and once returning to Modern, the tab background is
taken from a system colour, unlike previously where it was white)

If I replace those qx.theme.* with myapp.theme.Theme and
myapp.theme.Theme2, where Theme and Theme2.js only differ in that they
refer to Font.js and Font2.js respectively, and all theme files extend
qx.theme.modern.Whatever, there will be no theme switching.  There might
be a too strict check somewhere in the code whether to switch or not...
I'm not sure, I haven't looked yet.

If I edit for example qx.theme.classic.Font.fonts["default"].size and
switch away and back to the Classic theme, the font size will be updated
as appropriate.  This confirms that my "double buffering" idea as
mentioned in the previous email, could be used, and so, there's no need
to create more than two themes just to have dynamic sizes.  As long as
the theme switching actually does work – I guess if the app-local themes
extend different themes, they might be considered different enough to
force a redraw.

Also found that only Meta setTheme does actually do anything.  If I had
just done
qx.theme.manager.Font.getInstance().setTheme(qx.theme.classic.Font) it
would not have changed a thing.

On 10/17/2012 08:05 AM, Martin Wittemann wrote:
> Hey,
> I would suggest to create as many new custom themes as you need font sizes. 
> That way, you can simply set the theme and the new theme switching mechanism 
> (devel only currently) could take care of all the stuff. Just extend your 
> current theme and set another font theme for each theme.
> Regards,
> Martin
> 
> Am 16.10.2012 um 19:07 schrieb Henrik Pauli <[email protected]>:
> 
>> Hello list,
>>
>> I was wondering if it's possible to change part of a theme when
>> receiving an event.
>>
>> In more detail: what I'm looking for is that when the window is resized,
>> certain fonts (their class is defined in Font.js) should become bigger
>> or smaller all over the application (it's a Standalone app).
>>
>> Attaching to the resize event and getting the viewport size to calculate
>> with is easy:
>>
>> this.getRoot().addListener("resize", function (e) {
>>  var vw = qx.bom.Viewport.getWidth();
>>  var vh = qx.bom.Viewport.getHeight();
>>
>>  // ...
>> }, this);
>>
>> However, messing with myapp.theme.Font.fonts["fontclass"].size doesn't
>> seem to have an effect after the application has been rendered.  Or
>> maybe I'm poking at wrong values.
>>
>> Is there any way out of this without having to go over every single one
>> of my widgets and setFonting them manually?
>>
>> ------------------------------------------------------------------------------
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 


------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to