mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add Adw.MessageDialog responses extension
This commit is contained in:
parent
749ee03e86
commit
0cf9a8e4fc
7 changed files with 221 additions and 14 deletions
10
tests/samples/responses.blp
Normal file
10
tests/samples/responses.blp
Normal file
|
@ -0,0 +1,10 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
Adw.MessageDialog {
|
||||
responses [
|
||||
cancel: _("Cancel"),
|
||||
discard: _("Discard") destructive,
|
||||
save: "Save" suggested disabled,
|
||||
]
|
||||
}
|
11
tests/samples/responses.ui
Normal file
11
tests/samples/responses.ui
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="AdwMessageDialog">
|
||||
<responses>
|
||||
<response id="cancel" translatable="true">Cancel</response>
|
||||
<response id="discard" translatable="true" appearance="destructive">Discard</response>
|
||||
<response id="save" enabled="false" appearance="suggested">Save</response>
|
||||
</responses>
|
||||
</object>
|
||||
</interface>
|
|
@ -143,6 +143,17 @@ class TestSamples(unittest.TestCase):
|
|||
raise AssertionError()
|
||||
|
||||
def test_samples(self):
|
||||
try:
|
||||
import gi
|
||||
|
||||
gi.require_version("Adw", "1")
|
||||
from gi.repository import Adw
|
||||
|
||||
have_adw = True
|
||||
Adw.init()
|
||||
except:
|
||||
have_adw = False
|
||||
|
||||
self.assert_sample("accessibility")
|
||||
self.assert_sample("action_widgets")
|
||||
self.assert_sample("child_type")
|
||||
|
@ -166,6 +177,7 @@ class TestSamples(unittest.TestCase):
|
|||
) # The image resource doesn't exist
|
||||
self.assert_sample("property")
|
||||
self.assert_sample("property_binding")
|
||||
self.assert_sample("responses", skip_run=not have_adw)
|
||||
self.assert_sample("signal", skip_run=True) # The callback doesn't exist
|
||||
self.assert_sample("size_group")
|
||||
self.assert_sample("string_list")
|
||||
|
@ -257,6 +269,7 @@ class TestSamples(unittest.TestCase):
|
|||
self.assert_decompile("property")
|
||||
self.assert_decompile("property_binding_dec")
|
||||
self.assert_decompile("placeholder_dec")
|
||||
self.assert_decompile("responses")
|
||||
self.assert_decompile("signal")
|
||||
self.assert_decompile("strings")
|
||||
self.assert_decompile("style_dec")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue