Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static blur and rounding effect for dash-to-dock #533

Merged
merged 12 commits into from
Mar 5, 2024
Merged
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pot:
test-shell: install
env GNOME_SHELL_SLOWDOWN_FACTOR=2 \
MUTTER_DEBUG_DUMMY_MODE_SPECS=1500x1000 \
MUTTER_DEBUG_DUMMY_MONITOR_SCALES=1 \
MUTTER_DEBUG_DUMMY_MONITOR_SCALES=3 \
dbus-run-session -- gnome-shell --nested --wayland


Expand Down
59 changes: 52 additions & 7 deletions resources/ui/dash.ui
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Dash to Dock blur</property>
<property name="description" translatable="yes">Blur the background of the Dash to Dock extension, if it is used.</property>
<property name="description" translatable="yes">Blur the background of the Dash to Dock
extension, if it is used.</property>
<property name="header-suffix">
<object class="GtkSwitch" id="blur">
<property name="valign">center</property>
Expand All @@ -17,21 +18,57 @@

<child>
<object class="CustomizeRow" id="customize">
<property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
<property name="sensitive" bind-source="blur" bind-property="state"
bind-flags="sync-create" />
</object>
</child>

<child>
<object class="AdwExpanderRow" id="static_blur">
<property name="title" translatable="yes">Static blur</property>
<property name="subtitle" translatable="yes">Uses a static blurred image, can be used
with rounding effect.</property>
<property name="show-enable-switch">true</property>
<property name="sensitive" bind-source="blur" bind-property="state"
bind-flags="sync-create" />

<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Round corner radius</property>
<property name="subtitle" translatable="yes">The radius for the rounding effect.</property>
<property name="activatable-widget">radius_scale</property>

<child>
<object class="GtkScale" id="radius_scale">
<property name="valign">center</property>
<property name="hexpand">true</property>
<property name="width-request">200px</property>
<property name="draw-value">true</property>
<property name="value-pos">right</property>
<property name="orientation">horizontal</property>
<property name="digits">0</property>
<property name="adjustment">radius</property>
</object>
</child>
</object>
</child>
</object>
</child>

<child>
<object class="AdwExpanderRow" id="override_background">
<property name="title" translatable="yes">Override background</property>
<property name="subtitle" translatable="yes">Makes the background either transparent or semi-transparent, disable this to use Dash to Dock preferences instead.</property>
<property name="subtitle" translatable="yes">Makes the background either transparent or
semi-transparent, disable this to use Dash to Dock preferences instead.</property>
<property name="show-enable-switch">true</property>
<property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
<property name="sensitive" bind-source="blur" bind-property="state"
bind-flags="sync-create" />

<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Background style</property>
<property name="subtitle" translatable="yes">The transparent/semi-transparent style for the dock background.</property>
<property name="subtitle" translatable="yes">The transparent/semi-transparent style
for the dock background.</property>
<property name="activatable-widget">style_dash_to_dock</property>

<child>
Expand All @@ -48,9 +85,11 @@
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Disable in overview</property>
<property name="subtitle" translatable="yes">Disables the blur from Dash to Dock when entering the overview.</property>
<property name="subtitle" translatable="yes">Disables the blur from Dash to Dock when
entering the overview.</property>
<property name="activatable-widget">unblur_in_overview</property>
<property name="sensitive" bind-source="blur" bind-property="state" bind-flags="sync-create" />
<property name="sensitive" bind-source="blur" bind-property="state"
bind-flags="sync-create" />

<child>
<object class="GtkSwitch" id="unblur_in_overview">
Expand All @@ -70,4 +109,10 @@
<item translatable="yes">Dark</item>
</items>
</object>

<object class="GtkAdjustment" id="radius">
<property name="lower">0</property>
<property name="upper">40</property>
<property name="step-increment">1</property>
</object>
</interface>
5 changes: 5 additions & 0 deletions schemas/org.gnome.shell.extensions.blur-my-shell.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@
<default>false</default>
<summary>Boolean, whether to disable blur from this component when opening the overview or not</summary>
</key>
<!-- CORNER RADIUS -->
<key type="i" name="radius">
Copy link

@alissonlauffer alissonlauffer Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, Gnome 46 will replace sigma with radius in blur APIs. I'm not sure if we are going to reserve the radius key for Gnome 46+, or just keep the sigma key untouched, and assume radius = sigma * 2. See #532 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, we could use radius for blur settings and corner_radius for the rounding effect in GNOME 46.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I think we should use corner_radius and replace sigma by radius starting from GNOME 45, so that no change is required for it afterwards. Once this PR is merged, I will add the changes for GNOME 46 for the other blur effect!

<default>0</default>
<summary>Radius for corner rounding effect</summary>
</key>
</schema>

<!-- APPLICATIONS -->
Expand Down
Loading