Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 1 Support › Picture Viewer hide device statusbar

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12163

    David

    Hi,

    I want to hide the device status, when the Picture Viewer is showing. How can I do this?

    Greetings!

    #12168

    Günther
    Felgo Team

    Hi David!

    The status bar can be configured with the Theme.colors.statusBarStyle property:

    import Felgo 3.0
    import QtQuick 2.5
    
    App {
      id: app
    
      NavigationStack {
        splitView: false
    
        Page {
          title: "Status Bar Test"
    
          Column {
            anchors.centerIn: parent
    
            AppButton {
              text: "Show Status Bar"
              onClicked: Theme.colors.statusBarStyle = Theme.colors.statusBarStyleBlack
            }
    
            AppButton {
              text: "Hide Status Bar"
              onClicked: Theme.colors.statusBarStyle = Theme.colors.statusBarStyleHidden
            }
    
          }
        }
      }
    }
    

    Best,
    Günther

    • This reply was modified 8 years, 3 months ago by  GT.
    #12173

    David

    Ah,thanks, it works! But I have another problem now. If the PictureViewer is open, the statusbar is hidden, but how can I make the statusbar visible, when the PictureViewer is closed?

    #12190

    Günther
    Felgo Team

    Hi David!

    Good question! Had to play around a bit myself to work that one out 😉

    The tricky part is how to find out when the viewer is closed. Luckily the show method returns the viewer item, which has a property isOpen that we can use:

    import Felgo 3.0
    import QtQuick 2.0
    
    App {
      id: app
    
      // react to closing the picture viewer
      property Item viewer: null
      Connections {
        target: viewer
        onIsOpenChanged: if(!viewer.isOpen) Theme.colors.statusBarStyle = Theme.colors.statusBarStyleBlack
      }
    
      Page {
        // show image
        Image {
          source: "../assets/vplay-logo.png"
          anchors.centerIn: parent
    
          // open viewer if image clicked
          MouseArea {
            anchors.fill: parent
            onClicked: {
              viewer = PictureViewer.show(app, parent)
              Theme.colors.statusBarStyle = Theme.colors.statusBarStyleHidden
            }
          }
        }
      }
    }
    

     

    The Connections object allows to define a handler for signals of a certain target item, which is what we can use to find out when the viewer was closed. You can use this solution for now.

     

    While I was researching your problem, I made some adjustments to the PictureViewer item. As from the next Felgo release you can use it like this:

    import Felgo 3.0
    import QtQuick 2.0
    
    App {
      id: app
    
      // react to closing the picture viewer
      Connections {
        target: PictureViewer
        onClosed: Theme.colors.statusBarStyle = Theme.colors.statusBarStyleBlack
      }
    
      Page {
        // show image
        Image {
          source: "../assets/vplay-logo.png"
          anchors.centerIn: parent
    
          // open viewer if image clicked
          MouseArea {
            anchors.fill: parent
            onClicked: {
              PictureViewer.show(app, parent.source)
              Theme.colors.statusBarStyle = Theme.colors.statusBarStyleHidden
            }
          }
        }
      }
    }
    

     

    It will be possible to directly access onClosed and onOpened signals of the PictureViewer. Also, it will be possible to pass an url to the show method. (The current version expects an Image item.)

    Best,
    Günther

     

     

    • This reply was modified 8 years, 3 months ago by  GT.
Viewing 4 posts - 1 through 4 (of 4 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded