Try   HackMD

MR Doc: Port phosh-mobile-settings to AdwNavigationSplitView [!68]

Project: Phosh-Mobile-Settings
Author: Gotam Gorabh
Issue Solved: #33

Overview

Earlier phosh-mobile-settings uses AdwLeaflet but this will be deprecated in libadwaita 1.4 so It is better to port it to AdwNavigationSplitview.

What?

The AdwLeaflet widget can display its children like a GtkBox does or like a GtkStack does, adapting to size changes by switching between the two modes. When there is enough space the children are displayed side by side, otherwise only one is displayed and the leaflet is said to be β€œfolded”.

Whereas a widget presenting sidebar and content side by side or as a navigation view. AdwNavigationSplitView has two AdwNavigationPage children: sidebar and content, and displays them side by side.

When AdwNavigationSplitView:collapsed is set to TRUE, it instead puts both children inside an AdwNavigationView. The AdwNavigationSplitView:show-content controls which child is visible while collapsed.

AdwLeaflet

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More β†’

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More β†’

AdwNavigationSplitview

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More β†’

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More β†’

Why?

AdwLeaflet will be deprecated in libadwaita 1.4 so It is better to port it to AdwNavigationSplitview to give users latest interface.

How?

To implement this, I updated src/ui/mobile-settings-window.ui and src/mobile-settings-window.c files to implement AdwNavigationSplitview. I took help from this official docs.

I have also updated the src/meson.build file to use latest libadwaita as follow.

adwaita_dep = dependency(
  'libadwaita-1',
  version: '>= 1.4.alpha',
  fallback: ['libadwaita', 'adwaita_dep'],
  default_options: [
    'examples=false',
    'introspection=disabled',
    'tests=false',
  ],
)

Screenshots

Before Implementation

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More β†’

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More β†’

After Implementation

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More β†’

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More β†’