[Initiatives.wiki] Add some context for XML
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [Initiatives.wiki] Add some context for XML
- Date: Mon, 25 May 2020 14:36:25 +0000 (UTC)
commit 621225c34d6cdf72fbf16adc320df6c90cc8af37
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Mon May 25 14:36:24 2020 +0000
Add some context for XML
View-switcher-pattern-migration.md | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/View-switcher-pattern-migration.md b/View-switcher-pattern-migration.md
index 90ce229..86df217 100644
--- a/View-switcher-pattern-migration.md
+++ b/View-switcher-pattern-migration.md
@@ -69,7 +69,11 @@ After importing libhandy into the project, replace [`GtkStackSwitcher`](https://
Set the [policy](https://gnome.pages.gitlab.gnome.org/libhandy/HdyViewSwitcher.html#HdyViewSwitcher--policy)
to [`wide`](https://gnome.pages.gitlab.gnome.org/libhandy/HdyViewSwitcher.html#HdyViewSwitcherPolicy):
```xml
-<property name="policy">wide</property>
+<object class="HdyViewSwitcher">
+ <property name="visible">True</property>
+ <property name="stack">stack</property>
+ <property name="policy">wide</property>
+</object>
```
```c
@@ -83,10 +87,17 @@ While [`HdyViewSwitcher`](https://gnome.pages.gitlab.gnome.org/libhandy/HdyViewS
For every page in the [`GtkStack`](https://developer.gnome.org/gtk3/stable/GtkStack.html), set an icon using
the [`icon-name`](https://developer.gnome.org/gtk3/stable/GtkStack.html#GtkStack--c-icon-name) child property:
```xml
-<packing>
- <property name="title">Example</property>
- <property name="icon-name">face-smile-symbolic</property>
-</packing>
+<object class="GtkStack">
+ <child>
+ <object class="...">
+ ...
+ </object>
+ <packing>
+ <property name="title">Example</property>
+ <property name="icon-name">face-smile-symbolic</property>
+ </packing>
+ </child>
+</object>
```
```c
@@ -102,7 +113,11 @@ The recommended transition type to use with [`HdyViewSwitcher`](https://gnome.pa
It can be achieved by setting the
[`transition-type`](https://developer.gnome.org/gtk3/stable/GtkStack.html#GtkStack--transition-type) property
to
[`GTK_STACK_TRANSITION_TYPE_CROSSFADE`](https://developer.gnome.org/gtk3/stable/GtkStack.html#GtkStackTransitionType):
```xml
-<property name="transition-type">crossfade</property>
+<object class="GtkStack" id="stack">
+ <property name=visible">True</property>
+ <property name="transition-type">crossfade</property>
+ ...
+</object>
```
```c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]