papyros / qml-material

:book: Material Design implemented in QtQuick
GNU Lesser General Public License v2.1
2.57k stars 476 forks source link

actionBar.maxActionCount reset on ApplicationWindows PageStack.replace() #420

Open remi-parain opened 8 years ago

remi-parain commented 8 years ago

In ApplicationWindows the actionBar.maxActionCount is set accordingly to the initialPage.

A pagestack.push( Page{} ) / pop() on the applicationWindows works well ( all Pages's actionBar.maxActionCount are well set).

But on pagestack.replace(Page{}) , the actionBar.maxActionCount is set to the default one (based on DeviceType) and not based on the value set in the given Page parameter.

remi-parain commented 8 years ago

maybe i'm missing something and can't see the "big picture" , but see only 2 ways to resolve this

a) set an alias property in the applicationWindows to expose the toolbar allowing developer to override app-wide the toolbar behavior

b) do not force maxActionCount in the toolbar replace() function to let the page driving the behavior.

function replace(page) {
        //page.actionBar.maxActionCount = Qt.binding(function() { return toolbar.maxActionCount })
        toolbar.page = page

Am i missing something? Is there any reason to force the maxActionCount in ToolBar replace function?

and personally i prefer option b)