Bug 273787 - Implement a way to override theme property settings when loading themes (float visibility changes)
Summary: Implement a way to override theme property settings when loading themes (floa...
Status: REPORTED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: some future version
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-21 14:15 UTC by devel
Modified: 2013-10-20 08:27 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description devel 2011-05-21 14:15:46 UTC
Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

Theme definition files (.dgml) specify settings for many kinds of Marble properties. For some of them however, it may not be appropriate or desirable to have them change state when loading a theme.

More specifically, if the state of a float is saved as a map theme property, this will cause the float to revert to that state on a theme switch, which may not be desirable from a user interaction point of view. In a typical use case, the user deciding whether or not he wants to see certain floats is not related to a decision to switch themes. This is particularly so for floats that aid with map navigation (compass, overview).

What is proposed is that there should be a way to override certain property settings when loading a theme. A specific mechanism is not suggested, instead a couple of random ideas are given on how this could be done in a more or less general way:

 * Move from a binary to a ternary setting for properties. I.e., from false/true -> false/true/not-specified

 * Add a priority level to each property, as in CSS. I.e. something like
        <property name="compass">
                <value priority="important">true</value>
                <available>true</available>
        </property>



Reproducible: Always

Steps to Reproduce:
Take the following code snippet (not compilable, it is assumed a conceptual illustration should suffice)

void MyClass::myFunction()
{
    marble->setMapThemeId("earth/bluemarble/bluemarble.dgml");
    marble->setShowOverviewMap(state);
}

void MyClass::myOtherFunction()
{
    marble->setShowOverviewMap(state);
    marble->setMapThemeId("earth/bluemarble/bluemarble.dgml");
}



Actual Results:  
After execution myFunction(), the bluemarble theme is shown and the overview map is hidden.

After execution myOtherFunction(), the bluemarble theme is shown and the overview map is visible, in spite of having been set to hidden prior to calling setMapThemeId()

Expected Results:  
myFunction() and myOtherFunction() should behave the same, with both resulting in the overview map being hidden by the time the function returns.

Note: I have tried connecting a slot to the themeChanged() signal which would reset the properties to the state I wanted them on, with something like this:

void MyClass::setFloatsVisibility(MarbleWidget *marble)
{
    // Hide the FloatItems: Compass and StatusBar
    marble->setShowOverviewMap(false);
    marble->setShowScaleBar(false);
    marble->setShowCompass(false);
}

MyClass::MyClass
{
    connect(marble, SIGNAL(themeChanged()), this, SLOT(setFloatsVisibility()));
}

   The above kind of works, but it results in those floats flickering on and then back off, giving an unpleasant visual effect.