[Marble-bugs] [Bug 273787] New: Implement a way to override theme property settings when loading themes (float visibility changes)

devel at navlost.eu devel at navlost.eu
Sat May 21 14:15:47 CEST 2011


https://bugs.kde.org/show_bug.cgi?id=273787

           Summary: Implement a way to override theme property settings
                    when loading themes (float visibility changes)
           Product: marble
           Version: unspecified
          Platform: openSUSE RPMs
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: marble-bugs at kde.org
        ReportedBy: devel at navlost.eu


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.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Marble-bugs mailing list