scaling: Add GSettings for adjusting the height of the panel

Part-of: <https://gitlab.gnome.org/World/Phosh/squeekboard/-/merge_requests/679>
This commit is contained in:
MoonlightWave-12
2024-09-20 12:06:30 +02:00
parent 18bd7062f2
commit 5288e10cab
7 changed files with 136 additions and 8 deletions

View File

@ -1,5 +1,37 @@
gnome = import('gnome')
#workaround due to https://github.com/mesonbuild/meson/issues/1687
copy_schema = custom_target('copy-gschema-to-builddir',
input: 'sm.puri.Squeekboard.gschema.xml',
output: 'sm.puri.Squeekboard.gschema.xml',
command: ['cp', '@INPUT@', '@OUTPUT@']
)
schemas = ['sm.puri.Squeekboard.gschema.xml']
compile_schemas = custom_target('glib-compile-schemas',
build_by_default: true,
output: 'gschemas.compiled',
install: false,
command: [find_program('glib-compile-schemas'),
meson.current_build_dir()
],
depends: [copy_schema]
)
install_data(
schemas,
install_dir: schemasdir
)
compile_schemas = find_program('glib-compile-schemas', required: false)
if compile_schemas.found()
test('Validate schema file', compile_schemas,
args: ['--strict', '--dry-run', meson.current_source_dir()])
endif
install_data(
schemas,
install_dir: 'share/glib-2.0/schemas'
)
squeekboard_resources = gnome.compile_resources(
'squeekboard-resources',
'squeekboard.gresources.xml',

View File

@ -0,0 +1,32 @@
<schemalist>
<schema id="sm.puri.Squeekboard"
path="/sm/puri/Squeekboard/" >
<key name='scale-in-horizontal-screen-orientation' type='d'>
<range min="0.50" max="2.00"/>
<default>1.00</default>
<summary>The multiplier for the height of the panel while the screen is in landscape-orientation</summary>
<description>
The height of the panel for the layout is multiplied by this value,
while the screen is in landscape-orientation.
Changing this is currently mostly useful for custom layouts,
or to work around scaling-issues, because the layout-aspect-ratio is fixed.
There is an upper limit of 2/3 of the screen.
For square screens, the setting for screens in landscape-orientation is used.
</description>
</key>
<key name='scale-in-vertical-screen-orientation' type='d'>
<range min="0.50" max="2.00"/>
<default>1.00</default>
<summary>The multiplier for the height of the panel while the screen is in portrait-orientation</summary>
<description>
The height of the panel for the layout is multiplied by this value,
while the screen is in portrait-orientation.
Changing this is currently mostly useful for custom layouts,
or to work around scaling-issues, because the layout-aspect-ratio is fixed.
There is an upper limit of 2/3 of the screen.
For square screens, the setting for screens in landscape-orientation is used.
</description>
</key>
</schema>
</schemalist>