diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-11-22 17:12:04 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-11-22 18:33:39 +0100 |
commit | b4554b8eddd048532269df610e89ae739c46fab7 (patch) | |
tree | c373507b685e09ae4f2253274f9175f291650c0d /cui/qa | |
parent | e227d96bbc500afd810064eee64175b800bfc11f (diff) |
cui: add UI for semi-transparent shape text
- Make font color only work with the RGB color, otherwise the preview
would be white for e.g. half-transparent red.
- Add label and widget to see already set transparency.
- Add a flag to show these only for Draw/Impress and leave Writer/Calc
unchanged.
- Update returned item set to contain transparency in case the widget
changes.
Change-Id: If77771076ff4b10a4a5d468a6583809a94deb57e
Reviewed-on: https://gerrit.libreoffice.org/83520
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'cui/qa')
-rw-r--r-- | cui/qa/uitest/dialogs/chardlg.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/cui/qa/uitest/dialogs/chardlg.py b/cui/qa/uitest/dialogs/chardlg.py new file mode 100644 index 000000000000..59cf10d18c29 --- /dev/null +++ b/cui/qa/uitest/dialogs/chardlg.py @@ -0,0 +1,49 @@ +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.framework import UITestCase +from uitest.uihelper.common import select_pos + +# Test for cui/source/tabpages/chardlg.cxx. +class Test(UITestCase): + + def testSvxCharEffectsPage(self): + # Start Impress. + self.ui_test.create_doc_in_start_center("impress") + template = self.xUITest.getTopFocusWindow() + self.ui_test.close_dialog_through_button(template.getChild("cancel")) + doc = self.xUITest.getTopFocusWindow() + editWin = doc.getChild("impress_win") + # Select the title shape. + editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) + editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"})) + self.xUITest.executeCommand(".uno:SelectAll") + + # Now use Format -> Character. + self.ui_test.execute_dialog_through_command(".uno:FontDialog") + xDialog = self.xUITest.getTopFocusWindow() + xTabs = xDialog.getChild("tabcontrol") + # Select RID_SVXPAGE_CHAR_EFFECTS. + select_pos(xTabs, "1") + xFontTransparency = xDialog.getChild("fonttransparencymtr") + for _ in range(5): + xFontTransparency.executeAction("UP", tuple()) + self.ui_test.close_dialog_through_button(xDialog.getChild("ok")) + + # Verify the result. + component = self.ui_test.get_component() + drawPage = component.getDrawPages().getByIndex(0) + shape = drawPage.getByIndex(0) + + # Without the accompanying fix in place, this test would have failed with: + # AssertionError: 100 != 5 + # i.e. the dialog did not set transparency to 5%, instead it left the character color at + # COL_AUTO. + self.assertEqual(shape.CharTransparence, 5) + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: |