summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-01-19 21:38:30 -0500
committerMatthias Clasen <mclasen@redhat.com>2016-01-19 21:40:47 -0500
commitbb92428112b1b6ee4fae639e5190608c437c24b5 (patch)
tree765889c0eb986991a9468022d7c1156860a3948e /testsuite
parent0304817d8147d452eb7a5738db200306678218a4 (diff)
downloadgtk+-bb92428112b1b6ee4fae639e5190608c437c24b5.tar.gz
notebook: Implement rtl flipping for CSS nodes
Use gtk_box_gadget_reverse_children and gtk_css_node_reverse_children to flip the children of the header_gadget and the tabs_gadget when appropriate. Add new CSS node tests to verify that the node order is updated as expected in all cases.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/css/nodes/Makefile.am38
-rw-r--r--testsuite/css/nodes/notebook.bottom.ltr.nodes (renamed from testsuite/css/nodes/notebook.bottom.nodes)0
-rw-r--r--testsuite/css/nodes/notebook.bottom.ltr.ui (renamed from testsuite/css/nodes/notebook.bottom.ui)0
-rw-r--r--testsuite/css/nodes/notebook.bottom.rtl.nodes18
-rw-r--r--testsuite/css/nodes/notebook.bottom.rtl.ui56
-rw-r--r--testsuite/css/nodes/notebook.left.ltr.nodes (renamed from testsuite/css/nodes/notebook.left.nodes)0
-rw-r--r--testsuite/css/nodes/notebook.left.ltr.ui (renamed from testsuite/css/nodes/notebook.left.ui)0
-rw-r--r--testsuite/css/nodes/notebook.left.rtl.nodes18
-rw-r--r--testsuite/css/nodes/notebook.left.rtl.ui56
-rw-r--r--testsuite/css/nodes/notebook.right.ltr.nodes (renamed from testsuite/css/nodes/notebook.right.nodes)0
-rw-r--r--testsuite/css/nodes/notebook.right.ltr.ui (renamed from testsuite/css/nodes/notebook.right.ui)0
-rw-r--r--testsuite/css/nodes/notebook.right.rtl.nodes18
-rw-r--r--testsuite/css/nodes/notebook.right.rtl.ui56
-rw-r--r--testsuite/css/nodes/notebook.top.ltr.nodes (renamed from testsuite/css/nodes/notebook.top.nodes)0
-rw-r--r--testsuite/css/nodes/notebook.top.ltr.ui (renamed from testsuite/css/nodes/notebook.top.ui)0
-rw-r--r--testsuite/css/nodes/notebook.top.rtl.nodes18
-rw-r--r--testsuite/css/nodes/notebook.top.rtl.ui55
17 files changed, 316 insertions, 17 deletions
diff --git a/testsuite/css/nodes/Makefile.am b/testsuite/css/nodes/Makefile.am
index c00eaef18b..10dcc27ae4 100644
--- a/testsuite/css/nodes/Makefile.am
+++ b/testsuite/css/nodes/Makefile.am
@@ -28,23 +28,27 @@ test_css_nodes_SOURCES = \
$(NULL)
test_data = \
- box.ltr.ui box.ltr.nodes \
- box.rtl.ui box.rtl.nodes \
- buttons.ui buttons.nodes \
- checkbutton.ltr.ui checkbutton.ltr.nodes \
- checkbutton.rtl.ui checkbutton.rtl.nodes \
- entries.ui entries.nodes \
- expander.ltr.ui expander.ltr.nodes \
- expander.rtl.ui expander.rtl.nodes \
- levelbar.ltr.ui levelbar.ltr.nodes \
- levelbar.rtl.ui levelbar.rtl.nodes \
- notebook.top.ui notebook.top.nodes \
- notebook.left.ui notebook.left.nodes \
- notebook.right.ui notebook.right.nodes \
- notebook.bottom.ui notebook.bottom.nodes \
- paned.ltr.ui paned.ltr.nodes \
- paned.rtl.ui paned.rtl.nodes \
- progressbar.ui progressbar.nodes \
+ box.ltr.ui box.ltr.nodes \
+ box.rtl.ui box.rtl.nodes \
+ buttons.ui buttons.nodes \
+ checkbutton.ltr.ui checkbutton.ltr.nodes \
+ checkbutton.rtl.ui checkbutton.rtl.nodes \
+ entries.ui entries.nodes \
+ expander.ltr.ui expander.ltr.nodes \
+ expander.rtl.ui expander.rtl.nodes \
+ levelbar.ltr.ui levelbar.ltr.nodes \
+ levelbar.rtl.ui levelbar.rtl.nodes \
+ notebook.top.ltr.ui notebook.top.ltr.nodes \
+ notebook.top.rtl.ui notebook.top.rtl.nodes \
+ notebook.left.ltr.ui notebook.left.ltr.nodes \
+ notebook.left.rtl.ui notebook.left.rtl.nodes \
+ notebook.right.ltr.ui notebook.right.ltr.nodes \
+ notebook.right.rtl.ui notebook.right.rtl.nodes \
+ notebook.bottom.ltr.ui notebook.bottom.ltr.nodes \
+ notebook.bottom.rtl.ui notebook.bottom.rtl.nodes \
+ paned.ltr.ui paned.ltr.nodes \
+ paned.rtl.ui paned.rtl.nodes \
+ progressbar.ui progressbar.nodes \
$(NULL)
EXTRA_DIST += $(test_in_files) $(test_data)
diff --git a/testsuite/css/nodes/notebook.bottom.nodes b/testsuite/css/nodes/notebook.bottom.ltr.nodes
index 0177d1349a..0177d1349a 100644
--- a/testsuite/css/nodes/notebook.bottom.nodes
+++ b/testsuite/css/nodes/notebook.bottom.ltr.nodes
diff --git a/testsuite/css/nodes/notebook.bottom.ui b/testsuite/css/nodes/notebook.bottom.ltr.ui
index 176d2b8664..176d2b8664 100644
--- a/testsuite/css/nodes/notebook.bottom.ui
+++ b/testsuite/css/nodes/notebook.bottom.ltr.ui
diff --git a/testsuite/css/nodes/notebook.bottom.rtl.nodes b/testsuite/css/nodes/notebook.bottom.rtl.nodes
new file mode 100644
index 0000000000..fdf8204b80
--- /dev/null
+++ b/testsuite/css/nodes/notebook.bottom.rtl.nodes
@@ -0,0 +1,18 @@
+[window.background:dir(rtl)]
+ decoration:dir(ltr)
+ notebook.frame:dir(rtl)
+ stack:dir(ltr)
+ button#page1.text-button:dir(rtl)
+ label:dir(ltr)
+ button#page2.text-button:dir(rtl)
+ label:dir(ltr)
+ header.bottom:dir(ltr)
+ button#end.text-button:dir(rtl)
+ label:dir(ltr)
+ tabs:dir(ltr)
+ tab:dir(ltr)
+ label#tab2:dir(ltr)
+ tab:active:dir(ltr)
+ label#tab1:dir(ltr)
+ button#start.text-button:dir(rtl)
+ label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.bottom.rtl.ui b/testsuite/css/nodes/notebook.bottom.rtl.ui
new file mode 100644
index 0000000000..176d2b8664
--- /dev/null
+++ b/testsuite/css/nodes/notebook.bottom.rtl.ui
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkWindow" id="window1">
+ <property name="can_focus">False</property>
+ <property name="type">popup</property>
+ <child>
+ <object class="GtkNotebook">
+ <property name="visible">True</property>
+ <property name="tab-pos">bottom</property>
+ <child>
+ <object class="GtkButton">
+ <property name="name">page1</property>
+ <property name="label" translatable="yes">Yes</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel">
+ <property name="name">tab1</property>
+ <property name="label" translatable="yes">Tab 1</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="name">page2</property>
+ <property name="label" translatable="yes">No</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="tab2">
+ <property name="name">tab2</property>
+ <property name="label" translatable="yes">Tab 2</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="action-start">
+ <object class="GtkButton">
+ <property name="name">start</property>
+ <property name="label" translatable="yes">Action</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="action-end">
+ <object class="GtkButton">
+ <property name="name">end</property>
+ <property name="label" translatable="yes">Action</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/css/nodes/notebook.left.nodes b/testsuite/css/nodes/notebook.left.ltr.nodes
index ad04ef9ebd..ad04ef9ebd 100644
--- a/testsuite/css/nodes/notebook.left.nodes
+++ b/testsuite/css/nodes/notebook.left.ltr.nodes
diff --git a/testsuite/css/nodes/notebook.left.ui b/testsuite/css/nodes/notebook.left.ltr.ui
index 6c2d820ac0..6c2d820ac0 100644
--- a/testsuite/css/nodes/notebook.left.ui
+++ b/testsuite/css/nodes/notebook.left.ltr.ui
diff --git a/testsuite/css/nodes/notebook.left.rtl.nodes b/testsuite/css/nodes/notebook.left.rtl.nodes
new file mode 100644
index 0000000000..b1d4e2fb84
--- /dev/null
+++ b/testsuite/css/nodes/notebook.left.rtl.nodes
@@ -0,0 +1,18 @@
+[window.background:dir(rtl)]
+ decoration:dir(ltr)
+ notebook.frame:dir(rtl)
+ stack:dir(ltr)
+ button#page1.text-button:dir(rtl)
+ label:dir(ltr)
+ button#page2.text-button:dir(rtl)
+ label:dir(ltr)
+ header.right:dir(ltr)
+ button#start.text-button:dir(rtl)
+ label:dir(ltr)
+ tabs:dir(ltr)
+ tab:active:dir(ltr)
+ label#tab1:dir(ltr)
+ tab:dir(ltr)
+ label#tab2:dir(ltr)
+ button#end.text-button:dir(rtl)
+ label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.left.rtl.ui b/testsuite/css/nodes/notebook.left.rtl.ui
new file mode 100644
index 0000000000..6c2d820ac0
--- /dev/null
+++ b/testsuite/css/nodes/notebook.left.rtl.ui
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkWindow" id="window1">
+ <property name="can_focus">False</property>
+ <property name="type">popup</property>
+ <child>
+ <object class="GtkNotebook">
+ <property name="visible">True</property>
+ <property name="tab-pos">left</property>
+ <child>
+ <object class="GtkButton">
+ <property name="name">page1</property>
+ <property name="label" translatable="yes">Yes</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel">
+ <property name="name">tab1</property>
+ <property name="label" translatable="yes">Tab 1</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="name">page2</property>
+ <property name="label" translatable="yes">No</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="tab2">
+ <property name="name">tab2</property>
+ <property name="label" translatable="yes">Tab 2</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="action-start">
+ <object class="GtkButton">
+ <property name="name">start</property>
+ <property name="label" translatable="yes">Action</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="action-end">
+ <object class="GtkButton">
+ <property name="name">end</property>
+ <property name="label" translatable="yes">Action</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/css/nodes/notebook.right.nodes b/testsuite/css/nodes/notebook.right.ltr.nodes
index 500331cc50..500331cc50 100644
--- a/testsuite/css/nodes/notebook.right.nodes
+++ b/testsuite/css/nodes/notebook.right.ltr.nodes
diff --git a/testsuite/css/nodes/notebook.right.ui b/testsuite/css/nodes/notebook.right.ltr.ui
index 7bea7d947e..7bea7d947e 100644
--- a/testsuite/css/nodes/notebook.right.ui
+++ b/testsuite/css/nodes/notebook.right.ltr.ui
diff --git a/testsuite/css/nodes/notebook.right.rtl.nodes b/testsuite/css/nodes/notebook.right.rtl.nodes
new file mode 100644
index 0000000000..fe9dd83a85
--- /dev/null
+++ b/testsuite/css/nodes/notebook.right.rtl.nodes
@@ -0,0 +1,18 @@
+[window.background:dir(rtl)]
+ decoration:dir(ltr)
+ notebook.frame:dir(rtl)
+ header.left:dir(ltr)
+ button#start.text-button:dir(rtl)
+ label:dir(ltr)
+ tabs:dir(ltr)
+ tab:active:dir(ltr)
+ label#tab1:dir(ltr)
+ tab:dir(ltr)
+ label#tab2:dir(ltr)
+ button#end.text-button:dir(rtl)
+ label:dir(ltr)
+ stack:dir(ltr)
+ button#page1.text-button:dir(rtl)
+ label:dir(ltr)
+ button#page2.text-button:dir(rtl)
+ label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.right.rtl.ui b/testsuite/css/nodes/notebook.right.rtl.ui
new file mode 100644
index 0000000000..7bea7d947e
--- /dev/null
+++ b/testsuite/css/nodes/notebook.right.rtl.ui
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkWindow" id="window1">
+ <property name="can_focus">False</property>
+ <property name="type">popup</property>
+ <child>
+ <object class="GtkNotebook">
+ <property name="visible">True</property>
+ <property name="tab-pos">right</property>
+ <child>
+ <object class="GtkButton">
+ <property name="name">page1</property>
+ <property name="label" translatable="yes">Yes</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel">
+ <property name="name">tab1</property>
+ <property name="label" translatable="yes">Tab 1</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="name">page2</property>
+ <property name="label" translatable="yes">No</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="tab2">
+ <property name="name">tab2</property>
+ <property name="label" translatable="yes">Tab 2</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="action-start">
+ <object class="GtkButton">
+ <property name="name">start</property>
+ <property name="label" translatable="yes">Action</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="action-end">
+ <object class="GtkButton">
+ <property name="name">end</property>
+ <property name="label" translatable="yes">Action</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/css/nodes/notebook.top.nodes b/testsuite/css/nodes/notebook.top.ltr.nodes
index 6009264fa9..6009264fa9 100644
--- a/testsuite/css/nodes/notebook.top.nodes
+++ b/testsuite/css/nodes/notebook.top.ltr.nodes
diff --git a/testsuite/css/nodes/notebook.top.ui b/testsuite/css/nodes/notebook.top.ltr.ui
index a080a52d1d..a080a52d1d 100644
--- a/testsuite/css/nodes/notebook.top.ui
+++ b/testsuite/css/nodes/notebook.top.ltr.ui
diff --git a/testsuite/css/nodes/notebook.top.rtl.nodes b/testsuite/css/nodes/notebook.top.rtl.nodes
new file mode 100644
index 0000000000..4d460491f8
--- /dev/null
+++ b/testsuite/css/nodes/notebook.top.rtl.nodes
@@ -0,0 +1,18 @@
+[window.background:dir(rtl)]
+ decoration:dir(ltr)
+ notebook.frame:dir(rtl)
+ header.top:dir(ltr)
+ button#end.text-button:dir(rtl)
+ label:dir(ltr)
+ tabs:dir(ltr)
+ tab:dir(ltr)
+ label#tab2:dir(ltr)
+ tab:active:dir(ltr)
+ label#tab1:dir(ltr)
+ button#start.text-button:dir(rtl)
+ label:dir(ltr)
+ stack:dir(ltr)
+ button#page1.text-button:dir(rtl)
+ label:dir(ltr)
+ button#page2.text-button:dir(rtl)
+ label:dir(ltr)
diff --git a/testsuite/css/nodes/notebook.top.rtl.ui b/testsuite/css/nodes/notebook.top.rtl.ui
new file mode 100644
index 0000000000..a080a52d1d
--- /dev/null
+++ b/testsuite/css/nodes/notebook.top.rtl.ui
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkWindow" id="window1">
+ <property name="can_focus">False</property>
+ <property name="type">popup</property>
+ <child>
+ <object class="GtkNotebook">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton">
+ <property name="name">page1</property>
+ <property name="label" translatable="yes">Yes</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel">
+ <property name="name">tab1</property>
+ <property name="label" translatable="yes">Tab 1</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="name">page2</property>
+ <property name="label" translatable="yes">No</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="tab2">
+ <property name="name">tab2</property>
+ <property name="label" translatable="yes">Tab 2</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="action-start">
+ <object class="GtkButton">
+ <property name="name">start</property>
+ <property name="label" translatable="yes">Action</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ <child type="action-end">
+ <object class="GtkButton">
+ <property name="name">end</property>
+ <property name="label" translatable="yes">Action</property>
+ <property name="visible">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>