View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017285 | Scribus | User Interface | public | 2024-10-06 19:04 | 2024-10-23 15:31 |
Reporter | nitramr | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | new | Resolution | open | ||
Platform | Desktop PC | OS | Ubuntu | OS Version | 24.04 64-bit |
Product Version | 1.7.0.svn | ||||
Target Version | 1.7.0 | ||||
Summary | 0017285: Indigo UI: Text Properties Palette Redesign (+Style Manager Adjustments) | ||||
Description | A huge rework of the text properties panel is done. See screenshots. What's new? - 51 new icons (incl. some refinements of old ones) - 21 new previews for OpenType font features - Text panel has been divided into 3 areas (character, paragraph and layout) - Color selection is now also done via a round color button like in the Frame Properties panel - Paragraph and character styles can now be edited and created directly - Line styles can also be edited and created directly - The Hyphenation section has been expanded to include 2 buttons to enable or disable hyphenation in the text. The language selection for the text is also located there - First Line Offset & Optical Margins have been moved to Alignment & Tabs - Advanced Settings have been merged with the Text Effects in a new Typography section - The Style Manager (Character Styles + Paragraph Styles) has been largely aligned with the changes in the Text Properties panel (but still needs another iteration). This patch has some overlaps with this patch https://bugs.scribus.net/view.php?id=17283 PS: the patch file includes only modified files. New ones and all assets are in the zip file. PPS: the patch has over 18k lines of code. Most of the changes are related to the ui files. | ||||
Tags | No tags attached. | ||||
Patch | Yes | ||||
related to | 0017148 | new | Font Features squished | |
related to | 0012265 | assigned | nitramr | Optical margins setting too verbose and unintuitive |
related to | 0016509 | closed | nitramr | Update layout for Text Properties: unify buttons, layout, new |
related to | 0015914 | closed | nitramr | Indigo UI: Store the content / properties palette's panel collapsing status in the preferences |
related to | 0014512 | new | Re-order Text Properties items so that they make sense |
|
textprops_2024-10-06_01.patch (613,071 bytes)
Index: resources/iconsets/1_7_0/1_7_0.xml =================================================================== --- resources/iconsets/1_7_0/1_7_0.xml (Revision 26312) +++ resources/iconsets/1_7_0/1_7_0.xml (Arbeitskopie) @@ -31,7 +31,7 @@ <license>Apache 2.0</license> <path default="yes">1_7_0</path> <activeversion>1.7.0</activeversion> - <splashscreen left="0" top="0" width="476" height="410" imageDark="scribus_splash_dark.png" imageLight="scribus_splash_light.png"></splashscreen> + <splashscreen left="0" top="0" width="476" height="410" imageDark="images/scribus_splash_dark.png" imageLight="images/scribus_splash_light.png"></splashscreen> <!-- <variant>Dark</variant>--> <nametext lang="en_US">Scribus 1.7.0</nametext> <nametext lang="fr">Scribus 1.7.0</nametext> @@ -60,7 +60,6 @@ <icon id="16/edit-clear.png" file="16/action-delete.svg" /> <icon id="16/edit-copy.png" file="16/action-copy.svg" /> <icon id="16/edit-cut.png" file="16/action-cut.svg" /> - <icon id="16/edit-delete-all.png" file="16/action-delete.svg" /> <icon id="16/edit-delete.png" file="16/action-delete.svg" /> <icon id="16/edit-find-replace.png" file="16/action-file-search.svg" /> <icon id="16/edit-paste.png" file="16/action-paste.svg" /> @@ -139,17 +138,19 @@ <icon id="u_group.png" file="16/object-group.svg" /><!-- Outliner --> <icon id="u_undo16.png" file="16/action-undo.svg" /><!-- Barcode --> <icon id="ungroup.png" file="16/object-ungroup.svg" /> + <icon id="collapse" file="16/action-chevron-right.svg" /> + <icon id="context-menu" file="16/action-menu.svg" /> + <icon id="delete-selected" file="16/action-delete-selected.svg" /> + <icon id="erase-shadow-off" file="16/action-shadow-erase-off.svg" /> + <icon id="erase-shadow-on" file="16/action-shadow-erase-on.svg" /> <icon id="expand" file="16/action-chevron-down.svg" /> - <icon id="collapse" file="16/action-chevron-right.svg" /> + <icon id="inherit-opacity-off" file="16/action-inherit-opacity-off.svg" /> <icon id="inherit-opacity-on" file="16/action-inherit-opacity-on.svg" /> - <icon id="inherit-opacity-off" file="16/action-inherit-opacity-off.svg" /> - <icon id="erase-shadow-on" file="16/action-shadow-erase-on.svg" /> - <icon id="erase-shadow-off" file="16/action-shadow-erase-off.svg" /> + <icon id="reset" file="16/action-reload.svg" /> + <icon id="scale-height" file="16/action-scale-height.svg" /> + <icon id="scale-width" file="16/action-scale-width.svg" /> <icon id="swap" file="16/action-swap.svg" /> <icon id="toggle-object-coordination" file="16/object-xycoordination.svg" /> - <icon id="context-menu" file="16/action-menu.svg" /> - <icon id="scale-width" file="16/action-scale-width.svg" /> - <icon id="scale-height" file="16/action-scale-height.svg" /> <!-- Alerts --> <icon onLight="#E54545" onDark="#FF6666" id="22/dialog-error.png" file="16/alert-error.svg" /> @@ -225,6 +226,9 @@ <icon id="colorpicker-pattern" file="16/colorpicker-pattern.svg" /> <icon id="colorpicker-solid" file="16/colorpicker-solid.svg" /> <icon id="mask" file="16/color-mask.svg" /> + <icon id="text-color" file="16/text.svg" /> + <icon id="text-background-color" file="16/paragraph-align-horizontal-center.svg" /> + <icon id="text-outline-color" file="16/character-outline.svg" /> <!-- Cursor --> <icon id="LinkTextFrame.png" file="32/cursor-link-text-frame.svg" /> @@ -358,10 +362,6 @@ <icon id="16/page-4fold.png" file="16/page-type-fourfold.svg" /> <icon id="16/page-doublesided.png" file="16/page-type-facing.svg" /> <icon id="16/page-simple.png" file="16/page-type-single.svg" /> - <icon id="32/page-3fold.png" file="32/page-3fold.svg" /> - <icon id="32/page-4fold.png" file="32/page-4fold.svg" /> - <icon id="32/page-doublesided.png" file="32/page-double.svg" /> - <icon id="32/page-simple.png" file="32/page-simple.svg" /> <icon id="16/go-bottom.png" file="16/object-level-background.svg" /> <icon id="16/go-down.png" file="16/action-chevron-down.svg" /> <icon id="16/go-top.png" file="16/object-level-foreground.svg" /> @@ -381,16 +381,23 @@ <icon id="/16/list-remove.png" file="16/action-remove.svg" /> <icon id="16/list-remove.png" file="16/action-remove.svg" /> <icon id="22/list-remove.png" file="16/action-remove.svg" /> - <icon id="page-move" file="16/page-move.svg" /> - <icon id="page-insert" file="16/page-insert.svg" /> - <icon id="page-duplicate" file="16/page-duplicate.svg" /> - <icon id="page-import" file="16/page-import.svg" /> + <icon id="border-bottom" file="16/border-bottom.svg" /> + <icon id="border-inside" file="16/border-inside.svg" /> + <icon id="border-left" file="16/border-left.svg" /> + <icon id="border-outside" file="16/border-outside.svg" /> + <icon id="border-right" file="16/border-right.svg" /> + <icon id="border-top" file="16/border-top.svg" /> <icon id="layer-move-down" file="16/object-level-down.svg" /> <icon id="layer-move-up" file="16/object-level-up.svg" /> + <icon id="page-duplicate" file="16/page-duplicate.svg" /> <icon id="page-first-left" file="16/page-first-left.svg" /> <icon id="page-first-right" file="16/page-first-right.svg" /> + <icon id="page-import" file="16/page-import.svg" /> + <icon id="page-insert" file="16/page-insert.svg" /> + <icon id="page-move" file="16/page-move.svg" /> <icon id="page-orientation-horizontal" file="16/page-orientation-horizontal.svg" /> <icon id="page-orientation-vertical" file="16/page-orientation-vertical.svg" /> + <!-- PDF Tools --> <icon id="16/insert-button.png" file="16/pdf-button.svg" /> @@ -448,6 +455,7 @@ <icon id="plugins_16.png" file="16/properties-plugins.svg" /> <icon id="shortwords_16.png" file="16/properties-shortwords.svg" /> <icon id="python_16.png" file="16/properties-scripter.svg" /> + <icon id="section" file="16/properties-section.svg" /> <!-- Shape --> <icon id="flow-bounding.png" file="16/text-wrap-boundingbox.svg" /> @@ -470,6 +478,9 @@ <icon id="BevelJoin.png" file="16/stroke-join-bevel.svg" /> <icon id="penciladd.png" file="16/stroke-add.svg" /> <icon id="pencilsub.png" file="16/stroke-remove.svg" /> + <icon id="stroke-style" file="16/stroke-style.svg" /> + <icon id="stroke-style-edit" file="16/action-edit.svg" /> + <icon id="stroke-style-new" file="16/action-add.svg" /> <!-- Table --> <icon id="16/delete-table-columns.png" file="16/table-column-remove.svg" /> @@ -486,9 +497,6 @@ <icon id="22/split-table-cells.png" file="16/table-split-cell.svg" /> <!-- Text & Font--> - <icon id="above.png" file="16/paragraph-space-above.svg" /> - <icon id="below.png" file="16/paragraph-space-below.svg" /> - <icon id="22/text-align.png" file="16/no-icon.svg" /> <icon id="16/format-justify-center.png" file="16/paragraph-align-horizontal-center.svg" /> <icon id="16/format-justify-fill-block-right.png" file="16/paragraph-align-justify-rtl.svg" /> <icon id="16/format-justify-fill-block.png" file="16/paragraph-align-justify-ltr.svg" /> @@ -495,37 +503,83 @@ <icon id="16/format-justify-fill.png" file="16/paragraph-align-justify.svg" /> <icon id="16/format-justify-left.png" file="16/paragraph-align-left.svg" /> <icon id="16/format-justify-right.png" file="16/paragraph-align-right.svg" /> - <icon id="textbase.png" file="16/character-offset-baseline.svg" /> - <icon id="textkern.png" file="16/character-letter-spacing.svg" /> - <icon id="textscaleh.png" file="16/character-scale-width.svg" /> - <icon id="textscalev.png" file="16/character-scale-height.svg" /> - <icon id="tief.png" file="16/character-subscript.svg" /> - <icon id="hoch.png" file="16/character-superscript.svg" /> - <icon id="kapital.png" file="16/character-capitals-small.svg" /> - <icon id="AllCaps.png" file="16/character-capitals-all.svg" /> - <icon id="shadow.png" file="16/character-shadow.svg" /> - <icon id="outlined.png" file="16/character-outline.svg" /> - <icon id="unter.png" file="16/character-underline.svg" /> - <icon id="wordsOnly.png" file="16/character-underline-word.svg" /> - <icon id="strike.png" file="16/character-strikethrough.svg" /> <icon id="16/text-direction-ltr.png" file="16/paragraph-direction-ltr.svg" /> <icon id="16/text-direction-rtl.png" file="16/paragraph-direction-rtl.svg" /> - <icon id="spacewidth.png" file="16/character-space-width.svg" /> <icon id="font_otf16.png" file="16/font-otf.svg" /> <icon id="font_subst16.png" file="16/font-substitute.svg" /> <icon id="font_truetype16.png" file="16/font-truetype.svg" /> <icon id="font_type1_16.png" file="16/font-postscript.svg" /> - <icon id="22/language.png" file="16/paragraph-language.svg" /> - <icon id="22/character-style.png" file="16/character-style.svg" /> - <icon id="22/paragraph-style.png" file="16/paragraph-style.svg" /> - <icon id="linespacing2.png" file="16/font-lineheight.svg" /> - <icon id="zeichen.png" file="16/font-size.svg" /> - <icon id="firstline.png" file="16/paragraph-firstline.svg" /> - <icon id="leftindent.png" file="16/paragraph-indent-left.svg" /> - <icon id="rightindent.png" file="16/paragraph-indent-right.svg" /> - <icon id="22/orphan.png" file="16/paragraph-orphan.svg" /> - <icon id="22/widow.png" file="16/paragraph-widow.svg" /> - + <icon id="character-capitals-all" file="16/character-capitals-all.svg" /> + <icon id="character-capitals-small" file="16/character-capitals-small.svg" /> + <icon id="character-letter-tracking" file="16/character-letter-spacing.svg" /> + <icon id="character-offset-baseline" file="16/character-offset-baseline.svg" /> + <icon id="character-outline" file="16/character-outline.svg" /> + <icon id="character-scale-height" file="16/character-scale-height.svg" /> + <icon id="character-scale-width" file="16/character-scale-width.svg" /> + <icon id="character-scale-width-max" file="16/character-scale-width-max.svg" /> + <icon id="character-scale-width-min" file="16/character-scale-width-min.svg" /> + <icon id="character-shadow" file="16/character-shadow.svg" /> + <icon id="character-space-width" file="16/character-space-width.svg" /> + <icon id="character-space-width-min" file="16/character-space-width-min.svg" /> + <icon id="character-strikethrough" file="16/character-strikethrough.svg" /> + <icon id="character-style" file="16/character-style.svg" /> + <icon id="character-style-edit" file="16/action-edit.svg" /> + <icon id="character-style-new" file="16/action-add.svg" /> + <icon id="character-subscript" file="16/character-subscript.svg" /> + <icon id="character-superscript" file="16/character-superscript.svg" /> + <icon id="character-underline" file="16/character-underline.svg" /> + <icon id="character-underline-word" file="16/character-underline-word.svg" /> + <icon id="ff-afrc" file="16/ff-afrc.svg" /> + <icon id="ff-c2sc" file="16/ff-c2sc.svg" /> + <icon id="ff-c2sc-smcp" file="16/ff-c2sc-smcp.svg" /> + <icon id="ff-frac" file="16/ff-frac.svg" /> + <icon id="ff-lnum" file="16/ff-lnum.svg" /> + <icon id="ff-onum" file="16/ff-onum.svg" /> + <icon id="ff-ordn" file="16/ff-ordn.svg" /> + <icon id="ff-p2pc" file="16/ff-p2pc.svg" /> + <icon id="ff-p2pc-pcap" file="16/ff-p2pc-pcap.svg" /> + <icon id="ff-pcap" file="16/ff-pcap.svg" /> + <icon id="ff-pnum" file="16/ff-pnum.svg" /> + <icon id="ff-smcp" file="16/ff-smcp.svg" /> + <icon id="ff-subs" file="16/character-subscript.svg" /> + <icon id="ff-sups" file="16/character-superscript.svg" /> + <icon id="ff-titl" file="16/ff-titl.svg" /> + <icon id="ff-tnum" file="16/ff-tnum.svg" /> + <icon id="ff-unic" file="16/ff-unic.svg" /> + <icon id="flop-baseline" file="16/paragraph-offset-baseline.svg" /> + <icon id="flop-font" file="16/paragraph-offset-font.svg" /> + <icon id="flop-linespace" file="16/paragraph-offset-linespace.svg" /> + <icon id="flop-max" file="16/paragraph-offset-max.svg" /> + <icon id="font-face" file="16/properties-fonts.svg" /> + <icon id="font-size" file="16/font-size.svg" /> + <icon id="font-style" file="16/font-style.svg" /> + <icon id="hyphen-character" file="16/hyphenation-character.svg" /> + <icon id="hyphen-consecutive" file="16/hyphenation-consecutive.svg" /> + <icon id="hyphen-smallest-word" file="16/hyphenation-smallest-word.svg" /> + <icon id="paragraph-align-bottom" file="16/paragraph-align-bottom.svg" /> + <icon id="paragraph-align-top" file="16/paragraph-align-top.svg" /> + <icon id="paragraph-align-vertical-center" file="16/paragraph-align-vertical-center.svg" /> + <icon id="paragraph-columns" file="16/paragraph-columns.svg" /> + <icon id="paragraph-effects-style" file="16/paragraph-effects-style.svg" /> + <icon id="paragraph-indent-firstline" file="16/paragraph-firstline.svg" /> + <icon id="paragraph-indent-left" file="16/paragraph-indent-left.svg" /> + <icon id="paragraph-indent-right" file="16/paragraph-indent-right.svg" /> + <icon id="paragraph-language" file="16/paragraph-language.svg" /> + <icon id="paragraph-line-height" file="16/font-lineheight.svg" /> + <icon id="paragraph-list-offset" file="16/paragraph-list-indent-left.svg" /> + <icon id="paragraph-optical-margin-left" file="16/paragraph-optical-margin-left.svg" /> + <icon id="paragraph-optical-margin-right" file="16/paragraph-optical-margin-right.svg" /> + <icon id="paragraph-orphan" file="16/paragraph-orphan.svg" /> + <icon id="paragraph-space-above" file="16/paragraph-space-above.svg" /> + <icon id="paragraph-space-below" file="16/paragraph-space-below.svg" /> + <icon id="paragraph-style" file="16/paragraph-style.svg" /> + <icon id="paragraph-style-edit" file="16/action-edit.svg" /> + <icon id="paragraph-style-new" file="16/action-add.svg" /> + <icon id="paragraph-widow" file="16/paragraph-widow.svg" /> + <icon id="text-on-path-distance" file="16/text-on-path-distance.svg" /> + <icon id="text-on-path-flip" file="16/object-flip-vertical.svg" /> + <icon id="text-on-path-offset" file="16/text-on-path-offset.svg" /> + <!-- Tools --> <icon id="22/transform-crop-and-resize.png" file="16/tool-crop.svg" /> <icon id="16/pointer.png" file="16/tool-select.svg" /> @@ -578,10 +632,10 @@ <!-- Windows --> <icon id="close" file="16/action-close.svg" /> + <icon id="dock-auto-hide" file="16/action-pin.svg" /> <icon id="dock-float" file="16/action-window-float.svg" /> + <icon id="dock-minimize" file="16/action-minimize.svg" /> <icon id="menu-down" file="16/action-menu-down.svg" /> - <icon id="dock-auto-hide" file="16/action-pin.svg" /> - <icon id="dock-minimize" file="16/action-minimize.svg" /> <!-- Panels --> <icon id="panel-action-history" file="16/panel-action-history.svg" /> @@ -596,6 +650,29 @@ <icon id="panel-page" file="16/panel-page.svg" /> <icon id="panel-scrapbook" file="16/panel-scrapbook.svg" /> <icon id="panel-symbols" file="16/panel-symbols.svg" /> + + <!-- Open Type Font Feature Preview --> + <icon id="ff-preview-afrc" file="images/ff-afrc.svg" /> + <icon id="ff-preview-c2sc" file="images/ff-c2sc.svg" /> + <icon id="ff-preview-c2sc-smcp" file="images/ff-c2sc-smcp.svg" /> + <icon id="ff-preview-clig" file="images/ff-clig.svg" /> + <icon id="ff-preview-dlig" file="images/ff-dlig.svg" /> + <icon id="ff-preview-frac" file="images/ff-frac.svg" /> + <icon id="ff-preview-hlig" file="images/ff-hlig.svg" /> + <icon id="ff-preview-liga" file="images/ff-liga.svg" /> + <icon id="ff-preview-lnum" file="images/ff-lnum.svg" /> + <icon id="ff-preview-onum" file="images/ff-onum.svg" /> + <icon id="ff-preview-ordn" file="images/ff-ordn.svg" /> + <icon id="ff-preview-p2pc" file="images/ff-p2pc.svg" /> + <icon id="ff-preview-p2pc-pcap" file="images/ff-p2pc-pcap.svg" /> + <icon id="ff-preview-pcap" file="images/ff-pcap.svg" /> + <icon id="ff-preview-pnum" file="images/ff-pnum.svg" /> + <icon id="ff-preview-smcp" file="images/ff-smcp.svg" /> + <icon id="ff-preview-subs" file="images/ff-subs.svg" /> + <icon id="ff-preview-sups" file="images/ff-sups.svg" /> + <icon id="ff-preview-tnum" file="images/ff-tnum.svg" /> + <icon id="ff-preview-unic" file="images/ff-unic.svg" /> + <icon id="ff-preview-zero" file="images/ff-zero.svg" /> </icons> </iconset> Index: resources/iconsets/1_7_0/32/page-3fold.svg =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = image/svg+xml Property changes on: resources/iconsets/1_7_0/32/page-3fold.svg ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -image/svg+xml \ No newline at end of property Index: resources/iconsets/1_7_0/32/page-4fold.svg =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = image/svg+xml Property changes on: resources/iconsets/1_7_0/32/page-4fold.svg ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -image/svg+xml \ No newline at end of property Index: resources/iconsets/1_7_0/32/page-double.svg =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = image/svg+xml Property changes on: resources/iconsets/1_7_0/32/page-double.svg ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -image/svg+xml \ No newline at end of property Index: resources/iconsets/1_7_0/32/page-simple.svg =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = image/svg+xml Property changes on: resources/iconsets/1_7_0/32/page-simple.svg ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -image/svg+xml \ No newline at end of property Index: resources/iconsets/CMakeLists.txt =================================================================== --- resources/iconsets/CMakeLists.txt (Revision 26312) +++ resources/iconsets/CMakeLists.txt (Arbeitskopie) @@ -115,6 +115,10 @@ file( GLOB SCRIBUS_ICONS_1_7_0_32 1_7_0/32/*.svg) install(FILES ${SCRIBUS_ICONS_1_7_0_32} DESTINATION ${ICONDIR}/1_7_0/32) +#Install our images +file( GLOB SCRIBUS_ICONS_1_7_0_IMAGES 1_7_0/images/*.svg 1_7_0/images/*.png ) +install(FILES ${SCRIBUS_ICONS_1_7_0_IMAGES} DESTINATION ${ICONDIR}/1_7_0/images) + #Install our stylesheet icons file( GLOB SCRIBUS_ICONS_1_7_0_STYLE 1_7_0/stylesheet/*.png ) install(FILES ${SCRIBUS_ICONS_1_7_0_STYLE} DESTINATION ${ICONDIR}/1_7_0/stylesheet) @@ -123,8 +127,5 @@ file( GLOB SCRIBUS_XML_1_7_0 1_7_0/*.xml ) install(FILES ${SCRIBUS_XML_1_7_0} DESTINATION ${ICONDIR}) -#Install our tools icons -file( GLOB SCRIBUS_ICONS_1_7_0_TOOLS 1_7_0/tools/*.svg ) -install(FILES ${SCRIBUS_ICONS_1_7_0_TOOLS} DESTINATION ${ICONDIR}/1_7_0/tools) ################## Index: scribus/CMakeLists_Sources.txt =================================================================== --- scribus/CMakeLists_Sources.txt (Revision 26312) +++ scribus/CMakeLists_Sources.txt (Arbeitskopie) @@ -284,6 +284,7 @@ ui/actionsearchdialog.cpp ui/aligndistribute.cpp ui/alignselect.cpp + ui/alignverticalselect.cpp ui/directionselect.cpp ui/annot.cpp ui/annota.cpp @@ -325,6 +326,7 @@ ui/effectsdialog.cpp ui/extimageprops.cpp ui/filedialogeventcatcher.cpp + ui/flopwidget.cpp ui/fontcombo.cpp ui/fontembeddingcombo.cpp ui/fontembeddingmodel.cpp @@ -379,6 +381,7 @@ ui/nodeeditpalette.cpp ui/notesstyleseditor.cpp ui/numformatcombo.cpp + ui/opticalmarginswidget.cpp ui/outlinepalette.cpp ui/outputpreview_pdf.cpp ui/outputpreview_ps.cpp @@ -445,15 +448,14 @@ ui/propertiespalette_utils.cpp ui/propertiespalette_xyz.cpp ui/propertywidget_advanced.cpp + ui/propertywidget_alignment.cpp ui/propertywidget_distance.cpp + ui/propertywidget_paragraphstyle.cpp ui/propertywidget_pareffect.cpp - ui/propertywidget_flop.cpp ui/propertywidget_hyphenation.cpp - ui/propertywidget_optmargins.cpp ui/propertywidget_orphans.cpp ui/propertywidget_pathtext.cpp ui/propertywidget_text.cpp - ui/propertywidget_textcolor.cpp ui/propertywidget_fontfeatures.cpp ui/propertywidgetbase.cpp ui/proptree.cpp Index: scribus/iconmanager.cpp =================================================================== --- scribus/iconmanager.cpp (Revision 26312) +++ scribus/iconmanager.cpp (Arbeitskopie) @@ -81,10 +81,20 @@ return QIcon(loadPixmap(name, width)); } +QIcon IconManager::loadIcon(const QString &name, QSize size) +{ + return QIcon(loadPixmap(name, size)); +} + QPixmap IconManager::loadPixmap(const QString &name, int width) { - QString cName = buildName(name, "icon_", QString::number(width)); + return loadPixmap(name, QSize(width, width)); +} +QPixmap IconManager::loadPixmap(const QString &name, QSize size) +{ + QString cName = buildName(name, "icon_", QString::number(size.width()) + "_" + QString::number(size.height())); + // Use icon from icon cache if (m_pxCache.contains(cName)) return *m_pxCache[cName]; @@ -93,7 +103,7 @@ if (m_lookupTable.contains(name)) { Item item = m_lookupTable[name]; - m_pxCache.insert(cName, pixmapFromFile(item.filePath, item.color, width)); + m_pxCache.insert(cName, pixmapFromFile(item.filePath, item.color, size)); return *m_pxCache[cName]; } @@ -422,7 +432,7 @@ } #endif -QPixmap *IconManager::pixmapFromFile(const QString filePath, QColor color, int width) +QPixmap *IconManager::pixmapFromFile(const QString filePath, QColor color, QSize size) { QDomDocument document; // Load SVG file @@ -433,13 +443,37 @@ QSvgRenderer svgRenderer(document.toByteArray()); - QSize size = (width > -1) ? QSize(width, width) : svgRenderer.defaultSize(); - QPixmap *iconPixmap = new QPixmap(size * m_devicePixelRatio); + double svgWidth = svgRenderer.defaultSize().width(); + double svgHeight = svgRenderer.defaultSize().height(); + double width = (size.width() > 0) ? size.width() : svgWidth; + double height = (size.height() > 0) ? size.height() : svgHeight; + + QSize newSize(width, height); + + // invalid width + if (size.width() < 1) + { + double scaleFactor = (svgHeight > height) ? svgHeight / height : height / svgHeight; + newSize.setWidth(svgWidth * scaleFactor); + } + + // invalid height + if (size.height() < 1) + { + double scaleFactor = (svgWidth > width) ? svgWidth / width : width / svgWidth; + newSize.setHeight(svgHeight * scaleFactor); + } + + // something goes wrong and we fallback to original SVG size + if (!newSize.isValid()) + newSize = svgRenderer.defaultSize(); + + QPixmap *iconPixmap = new QPixmap(newSize * m_devicePixelRatio); iconPixmap->setDevicePixelRatio(m_devicePixelRatio); iconPixmap->fill(Qt::transparent); QPainter painter(iconPixmap); - svgRenderer.render(&painter, QRect(QPoint(0, 0), size)); + svgRenderer.render(&painter, QRect(QPoint(0, 0), newSize)); painter.end(); return iconPixmap; @@ -452,8 +486,9 @@ QPixmap *IconManager::pixmapFromPainterPath(QPainterPath path) { - QSize size(path.boundingRect().width(), path.boundingRect().height()); - QPixmap pixmap(size); + QSize size(path.boundingRect().size().toSize()); + QPixmap pixmap(size * m_devicePixelRatio); + pixmap.setDevicePixelRatio(m_devicePixelRatio); pixmap.fill(Qt::transparent); QPainter painter(&pixmap); painter.setRenderHint(QPainter::Antialiasing, true); Index: scribus/iconmanager.h =================================================================== --- scribus/iconmanager.h (Revision 26312) +++ scribus/iconmanager.h (Arbeitskopie) @@ -52,7 +52,9 @@ QCursor loadCursor(const QString& name, int hotX = -1, int hotY = -1, int width = -1); QIcon loadIcon(const QString& name, int width = -1); + QIcon loadIcon(const QString& name, QSize size); QPixmap loadPixmap(const QString& name, int width = -1); + QPixmap loadPixmap(const QString& name, QSize size); void addIconFromPainterPath(const QString & name, QPainterPath path); @@ -100,7 +102,7 @@ bool createLookupTable(); bool readXMLFile(QString filePath, QDomDocument &document, QString fileExtension); - QPixmap *pixmapFromFile(const QString filePath, QColor color, int width = -1); + QPixmap *pixmapFromFile(const QString filePath, QColor color, QSize size); QPixmap *pixmapFromPainterPath(QPainterPath path); QString buildName(const QString &name, const QString &prefix = "", const QString &suffix = "") const; Index: scribus/scribusapp.cpp =================================================================== --- scribus/scribusapp.cpp (Revision 26312) +++ scribus/scribusapp.cpp (Arbeitskopie) @@ -33,6 +33,7 @@ #include <QLocale> #include <QString> #include <QStringList> +#include <QStyleHints> #include <QTextCodec> #include <QTextStream> #include <QTranslator> @@ -347,6 +348,18 @@ int ScribusQApp::init() { + +#if (defined Q_OS_LINUX && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)) + // As long as this bug persists, we have to repair the palette ourselves + // https://bugreports.qt.io/browse/QTBUG-126208 + // See color values of fusion palette here: https://github.com/qt/qtbase/blob/dev/src/gui/kernel/qplatformtheme.cpp#L356 + if (this->styleHints()->colorScheme() == Qt::ColorScheme::Light && this->style()->name() == "fusion") + { + QPalette pal(QColor(239, 239, 239)); + this->setPalette(pal); + } +#endif + m_ScCore = new ScribusCore(); Q_CHECK_PTR(m_ScCore); if (!m_ScCore) Index: scribus/ui/alignselect.cpp =================================================================== --- scribus/ui/alignselect.cpp (Revision 26312) +++ scribus/ui/alignselect.cpp (Arbeitskopie) @@ -14,45 +14,41 @@ #include "iconmanager.h" #include "scribusapp.h" -AlignSelect::AlignSelect(QWidget* parent) : QWidget(parent) +AlignSelect::AlignSelect(QWidget* parent) : FormWidget(parent) { IconManager& im = IconManager::instance(); buttonGroup = new QButtonGroup(this); - GroupAlignLayout = new QHBoxLayout( this ); - GroupAlignLayout->setSpacing(3); - GroupAlignLayout->setContentsMargins(0, 0, 0, 0); - TextL = new QToolButton( this ); - TextL->setIcon(im.loadIcon("16/format-justify-left.png")); TextL->setCheckable( true ); TextL->setChecked( true ); - GroupAlignLayout->addWidget( TextL ); buttonGroup->addButton(TextL, 0); TextC = new QToolButton( this ); - TextC->setIcon(im.loadIcon("16/format-justify-center.png")); TextC->setCheckable( true ); - GroupAlignLayout->addWidget( TextC ); buttonGroup->addButton(TextC, 1); TextR = new QToolButton( this ); - TextR->setIcon(im.loadIcon("16/format-justify-right.png")); TextR->setCheckable( true ); - GroupAlignLayout->addWidget( TextR ); buttonGroup->addButton(TextR, 2); TextB = new QToolButton( this ); - TextB->setIcon(im.loadIcon("16/format-justify-fill-block.png")); TextB->setCheckable( true ); - GroupAlignLayout->addWidget( TextB ); buttonGroup->addButton(TextB, 3); TextF = new QToolButton( this ); - TextF->setIcon(im.loadIcon("16/format-justify-fill.png")); TextF->setCheckable( true ); - GroupAlignLayout->addWidget( TextF ); buttonGroup->addButton(TextF, 4); + + addWidget(TextL); + addWidget(TextC); + addWidget(TextR); + addWidget(TextB); + addWidget(TextF); + + iconSetChange(); + languageChange(); + resize(minimumSizeHint()); connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); @@ -123,4 +119,5 @@ TextC->setToolTip( tr("Align Text Center")); TextB->setToolTip( tr("Align Text Justified")); TextF->setToolTip( tr("Align Text Forced Justified")); + setText( tr("&Horizontal")); } Index: scribus/ui/alignselect.h =================================================================== --- scribus/ui/alignselect.h (Revision 26312) +++ scribus/ui/alignselect.h (Arbeitskopie) @@ -14,8 +14,9 @@ class QEvent; #include "scribusapi.h" +#include "ui/widgets/form_widget.h" -class SCRIBUS_API AlignSelect : public QWidget +class SCRIBUS_API AlignSelect : public FormWidget { Q_OBJECT @@ -42,8 +43,6 @@ void setTypeStyle(int a); protected: - QHBoxLayout* GroupAlignLayout { nullptr }; - void changeEvent(QEvent *e) override; signals: Index: scribus/ui/colorpicker/colorpicker.cpp =================================================================== --- scribus/ui/colorpicker/colorpicker.cpp (Revision 26312) +++ scribus/ui/colorpicker/colorpicker.cpp (Arbeitskopie) @@ -88,7 +88,7 @@ * * ********************************************************************************* */ -void ColorPicker::setGeneralData(CPGeneralData data) +void ColorPicker::setGeneralData(const CPGeneralData& data) { m_generalData = data; @@ -107,7 +107,7 @@ colorEdit->setColorData(data); } -CPColorData ColorPicker::colorData() const +const CPColorData& ColorPicker::colorData() const { return colorEdit->colorData(); } @@ -118,7 +118,7 @@ gradientEdit->setGradientData(data); } -CPGradientData ColorPicker::gradientData() const +const CPGradientData& ColorPicker::gradientData() const { return gradientEdit->gradientData(); } @@ -300,6 +300,9 @@ default: case Context::Simple: case Context::LineMask: + case Context::Text: + case Context::TextBackground: + case Context::TextOutline: buttonSolid->setVisible(false); buttonGradient->setVisible(false); buttonHatch->setVisible(false); @@ -577,7 +580,8 @@ enablePatterns(); // Connect automatic selection handling only if the context handles the items within the color picker - if ( (context() == Context::Fill) || (context() == Context::FillMask) || (context() == Context::Line) || (context() == Context::LineMask)) + if ( (context() == Context::Fill) || (context() == Context::FillMask) || (context() == Context::Line) || (context() == Context::LineMask + || context() == Context::Text || context() == Context::TextBackground || context() == Context::TextOutline)) { connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); connect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); Index: scribus/ui/colorpicker/colorpicker.h =================================================================== --- scribus/ui/colorpicker/colorpicker.h (Revision 26312) +++ scribus/ui/colorpicker/colorpicker.h (Arbeitskopie) @@ -22,13 +22,13 @@ void setDoc(ScribusDoc* doc); - void setGeneralData(CPGeneralData data); + void setGeneralData(const CPGeneralData &data); const CPGeneralData& generalData() const; void setColorData(const CPColorData& data); - CPColorData colorData() const; + const CPColorData& colorData() const; - CPGradientData gradientData() const; + const CPGradientData& gradientData() const; void setGradientData(const CPGradientData& data); const CPGradientVectorData& gradientVectorData() const; Index: scribus/ui/colorpicker/colorpicker.ui =================================================================== --- scribus/ui/colorpicker/colorpicker.ui (Revision 26312) +++ scribus/ui/colorpicker/colorpicker.ui (Arbeitskopie) @@ -113,7 +113,7 @@ <item> <spacer name="horizontalSpacer"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -152,10 +152,10 @@ <item> <spacer name="horizontalSpacer_3"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> + <enum>QSizePolicy::Policy::Fixed</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -171,7 +171,7 @@ <item> <spacer name="horizontalSpacer_2"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -187,7 +187,7 @@ <string/> </property> <property name="popupMode"> - <enum>QToolButton::InstantPopup</enum> + <enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum> </property> </widget> </item> @@ -195,6 +195,18 @@ </item> <item> <widget class="StackedContainer" name="stack"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>360</width> + <height>0</height> + </size> + </property> <widget class="ColorPickerColor" name="colorEdit"/> <widget class="ColorPickerGradient" name="gradientEdit"/> <widget class="ColorPickerHatch" name="hatchEdit"/> Index: scribus/ui/colorpicker/colorpicker_color.cpp =================================================================== --- scribus/ui/colorpicker/colorpicker_color.cpp (Revision 26312) +++ scribus/ui/colorpicker/colorpicker_color.cpp (Arbeitskopie) @@ -76,6 +76,15 @@ numberAlpha->setVisible(false); labelAlpha->setVisible(false); break; + case Context::Text: + case Context::TextBackground: + case Context::TextOutline: + sectionSwatches->setVisible(true); + numberShade->setVisible(true); + labelShade->setVisible(true); + numberAlpha->setVisible(false); + labelAlpha->setVisible(false); + break; case Context::Fill: sectionSwatches->setVisible(true); numberShade->setVisible(true); Index: scribus/ui/contentpalette.cpp =================================================================== --- scribus/ui/contentpalette.cpp (Revision 26312) +++ scribus/ui/contentpalette.cpp (Arbeitskopie) @@ -25,8 +25,8 @@ #include "styles/paragraphstyle.h" #include "styles/charstyle.h" -ContentPalette::ContentPalette(QWidget *parent) : - DockPanelBase("ContentPalette", "panel-content-properties", parent) +ContentPalette::ContentPalette(QWidget *parent) : + DockPanelBase("ContentPalette", "panel-content-properties", parent) { setObjectName(QString::fromLocal8Bit("ContentPalette")); @@ -34,7 +34,7 @@ f.setPointSize(f.pointSize()-1); setFont(f); - stackedWidget = new QStackedWidget(this); + stackedWidget = new StackedContainer(this); defaultPal = new ContentPalette_Default(this); stackedWidget->addWidget(defaultPal); @@ -276,7 +276,7 @@ updatePanelTitle(); } updateGeometry(); - DockPanelBase::update(); + DockPanelBase::update(); } void ContentPalette::unitChange() @@ -303,7 +303,6 @@ return; tablePal->updateColorList(); - textPal->updateColorList(); assert (m_doc->PageColors.document()); } @@ -320,7 +319,7 @@ languageChange(); return; } - DockPanelBase::changeEvent(e); + DockPanelBase::changeEvent(e); } void ContentPalette::updatePanelTitle() Index: scribus/ui/contentpalette.h =================================================================== --- scribus/ui/contentpalette.h (Revision 26312) +++ scribus/ui/contentpalette.h (Arbeitskopie) @@ -8,9 +8,9 @@ #define CONTENTPALETTE_H #include "scribusapi.h" -#include "scdockpalette.h" -#include "docks/dock_panelbase.h" +#include "docks/dock_panelbase.h" #include "scguardedptr.h" +#include "widgets/stacked_container.h" class QStackedWidget; @@ -29,7 +29,7 @@ class ParagraphStyle; class CharStyle; -class SCRIBUS_API ContentPalette : public DockPanelBase +class SCRIBUS_API ContentPalette : public DockPanelBase { Q_OBJECT @@ -75,7 +75,7 @@ double m_unitRatio {1.0}; int m_unitIndex {0}; - QStackedWidget* stackedWidget {nullptr}; + StackedContainer* stackedWidget {nullptr}; ContentPalette_Default* defaultPal {nullptr}; PropertiesPalette_Group* groupPal {nullptr}; PropertiesPalette_Image* imagePal {nullptr}; Index: scribus/ui/directionselect.cpp =================================================================== --- scribus/ui/directionselect.cpp (Revision 26312) +++ scribus/ui/directionselect.cpp (Arbeitskopie) @@ -13,30 +13,26 @@ #include "iconmanager.h" #include "scribusapp.h" -DirectionSelect::DirectionSelect(QWidget* parent) : QWidget(parent) +DirectionSelect::DirectionSelect(QWidget* parent) : FormWidget(parent) { buttonGroup = new QButtonGroup(this); - groupSelectLayout = new QHBoxLayout( this ); - groupSelectLayout->setSpacing(3); - groupSelectLayout->setContentsMargins(6, 0, 6, 0); - groupSelectLayout->setAlignment(Qt::AlignRight); - LTR = new QToolButton( this ); - LTR->setIcon(IconManager::instance().loadIcon("16/text-direction-ltr.png")); LTR->setCheckable( true ); LTR->setChecked( true ); - groupSelectLayout->addWidget( LTR ); + addWidget( LTR ); buttonGroup->addButton(LTR, 0); RTL = new QToolButton( this ); - RTL->setIcon(IconManager::instance().loadIcon("16/text-direction-rtl.png")); RTL->setCheckable( true ); - groupSelectLayout->addWidget( RTL ); + addWidget( RTL ); buttonGroup->addButton(RTL, 1); resize(minimumSizeHint()); + iconSetChange(); + languageChange(); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(buttonGroup, SIGNAL(idClicked(int)), this, SLOT(setTypeStyle(int))); } @@ -89,5 +85,6 @@ { LTR->setToolTip( tr("Left to right paragraph")); RTL->setToolTip( tr("Right to left paragraph")); + setText( tr("&Direction")); } Index: scribus/ui/directionselect.h =================================================================== --- scribus/ui/directionselect.h (Revision 26312) +++ scribus/ui/directionselect.h (Arbeitskopie) @@ -16,8 +16,9 @@ class QEvent; #include "scribusapi.h" +#include "ui/widgets/form_widget.h" -class SCRIBUS_API DirectionSelect : public QWidget +class SCRIBUS_API DirectionSelect : public FormWidget { Q_OBJECT @@ -38,8 +39,6 @@ void languageChange(); protected: - QHBoxLayout* groupSelectLayout { nullptr }; - int m_selected { 0 }; void changeEvent(QEvent *e) override; Index: scribus/ui/fontcombo.cpp =================================================================== --- scribus/ui/fontcombo.cpp (Revision 26312) +++ scribus/ui/fontcombo.cpp (Arbeitskopie) @@ -111,40 +111,43 @@ QWidget(parent), prefsManager(PrefsManager::instance()), showLabels(labels) -{ - ttfFont = IconManager::instance().loadPixmap("font_truetype16.png"); - otfFont = IconManager::instance().loadPixmap("font_otf16.png"); - psFont = IconManager::instance().loadPixmap("font_type1_16.png"); - substFont = IconManager::instance().loadPixmap("font_subst16.png"); - fontComboLayout = new QGridLayout(this); - fontComboLayout->setContentsMargins(0, 0, 0, 0); - if (showLabels) - fontComboLayout->setSpacing(6); - else - fontComboLayout->setSpacing(3); - int col = 0; - if (showLabels) - { - fontFaceLabel = new QLabel(this); - fontStyleLabel = new QLabel(this); - fontComboLayout->addWidget(fontFaceLabel, 0, 0); - fontComboLayout->addWidget(fontStyleLabel, 1, 0); - fontComboLayout->setColumnStretch(1, 10); - col = 1; - } +{ fontFamily = new QComboBox(this); fontFamily->setEditable(true); fontFamily->setValidator(new FontComboValidator(fontFamily)); fontFamily->setInsertPolicy(QComboBox::NoInsert); fontFamily->setItemDelegate(new FontFamilyDelegate(this)); - fontComboLayout->addWidget(fontFamily, 0, col); + + fontFaceLabel = new FormWidget(this); + fontFaceLabel->setLabelVisibility(false); + fontFaceLabel->addWidget(fontFamily); + fontStyle = new QComboBox(this); - fontComboLayout->addWidget(fontStyle, 1, col); + fontStyle->setSizeAdjustPolicy(QComboBox::AdjustToContents); + + fontStyleLabel = new FormWidget(this); + fontStyleLabel->addWidget(fontStyle); + + fontComboLayout = new QGridLayout(this); + fontComboLayout->setContentsMargins(0, 0, 0, 0); + fontComboLayout->setSpacing(8); + fontComboLayout->addWidget(fontFaceLabel, 0, 0, 1, 4); + fontComboLayout->addWidget(fontStyleLabel, 1, 0); + fontComboLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding), 1, 1); + fontComboLayout->addWidget(new QWidget(), 1, 2); + fontComboLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 1, 3); + isForAnnotation = true; // this is merely to ensure that the list is rebuilt + + iconSetChange(); + languageChange(); rebuildList(nullptr); + connect(fontFamily, SIGNAL(activated(int)), this, SLOT(familySelected(int))); connect(fontStyle, SIGNAL(activated(int)), this, SLOT(styleSelected(int))); - languageChange(); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + //connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); + } void FontComboH::changeEvent(QEvent *e) @@ -157,15 +160,30 @@ void FontComboH::languageChange() { - if (showLabels) - { - fontFaceLabel->setText( tr("Family:")); - fontStyleLabel->setText( tr("Style:")); - } + fontFaceLabel->setText( tr("Family")); + fontStyleLabel->setText( tr("Style")); fontFamily->setToolTip( tr("Font Family of Selected Text or Text Frame")); fontStyle->setToolTip( tr("Font Style of Selected Text or Text Frame")); } +void FontComboH::iconSetChange() +{ + IconManager &im = IconManager::instance(); + + ttfFont = im.loadPixmap("font_truetype16.png"); + otfFont = im.loadPixmap("font_otf16.png"); + psFont = im.loadPixmap("font_type1_16.png"); + substFont = im.loadPixmap("font_subst16.png"); + + fontFaceLabel->setPixmap(im.loadPixmap("font-face")); + fontStyleLabel->setPixmap(im.loadPixmap("font-style")); +} + +void FontComboH::toggleLabelVisibility(bool v) +{ + fontStyleLabel->setLabelVisibility(v); +} + void FontComboH::familySelected(int id) { disconnect(fontStyle, SIGNAL(activated(int)), this, SLOT(styleSelected(int))); @@ -332,6 +350,19 @@ fontStyle->blockSignals(styleSigBlocked); } +void FontComboH::setGuestWidget(QWidget *widget) +{ + fontComboLayout->addWidget(widget, 1, 2); +} + +QWidget *FontComboH::guestWidget() +{ + if (fontComboLayout->itemAtPosition(1, 2)->widget() == nullptr) + return new QWidget(); + + return fontComboLayout->itemAtPosition(1, 2)->widget(); +} + // This code borrowed from Qt project qfontcombobox.cpp static QFontDatabase::WritingSystem writingSystemFromScript(QLocale::Script script) Index: scribus/ui/fontcombo.h =================================================================== --- scribus/ui/fontcombo.h (Revision 26312) +++ scribus/ui/fontcombo.h (Arbeitskopie) @@ -30,6 +30,7 @@ #include <QValidator> #include "scribusapi.h" +#include "ui/widgets/form_widget.h" class QEvent; class QFont; @@ -76,9 +77,14 @@ QString currentFont() const; void rebuildList(ScribusDoc *currentDoc, bool forAnnotation = false, bool forSubstitute = false); + void setGuestWidget( QWidget * widget); + QWidget* guestWidget(); + public slots: void setCurrentFont(const QString& f); void languageChange(); + void iconSetChange(); + void toggleLabelVisibility(bool v); signals: void fontSelected(QString); @@ -90,8 +96,8 @@ protected: QComboBox* fontFamily { nullptr }; QComboBox* fontStyle { nullptr }; - QLabel *fontFaceLabel { nullptr }; - QLabel *fontStyleLabel { nullptr }; + FormWidget *fontFaceLabel { nullptr }; + FormWidget *fontStyleLabel { nullptr }; QGridLayout* fontComboLayout { nullptr }; PrefsManager& prefsManager; ScribusDoc *currDoc { nullptr }; Index: scribus/ui/newdocdialog.ui =================================================================== --- scribus/ui/newdocdialog.ui (Revision 26312) +++ scribus/ui/newdocdialog.ui (Arbeitskopie) @@ -119,7 +119,7 @@ <x>0</x> <y>0</y> <width>304</width> - <height>638</height> + <height>624</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout_7"> @@ -181,6 +181,21 @@ </property> <widget class="QWidget" name="page"> <layout class="QVBoxLayout" name="verticalLayout_6"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_10"> <item> @@ -483,6 +498,21 @@ </property> <widget class="QWidget" name="page_2"> <layout class="QVBoxLayout" name="verticalLayout_8"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> <widget class="NewMarginWidget" name="marginGroup" native="true"/> </item> @@ -497,6 +527,21 @@ </property> <widget class="QWidget" name="page_3"> <layout class="QVBoxLayout" name="verticalLayout_9"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> <widget class="NewMarginWidget" name="bleedGroup" native="true"/> </item> @@ -514,6 +559,21 @@ </property> <widget class="QWidget" name="page_4"> <layout class="QVBoxLayout" name="verticalLayout_10"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> <widget class="QCheckBox" name="autoTextFrame"> <property name="text"> @@ -752,7 +812,7 @@ <customwidget> <class>NewMarginWidget</class> <extends>QWidget</extends> - <header location="global">ui/newmarginwidget.h</header> + <header>ui/newmarginwidget.h</header> <container>1</container> </customwidget> <customwidget> Index: scribus/ui/newmarginwidget.cpp =================================================================== --- scribus/ui/newmarginwidget.cpp (Revision 26312) +++ scribus/ui/newmarginwidget.cpp (Arbeitskopie) @@ -6,11 +6,12 @@ */ #include "newmarginwidget.h" +#include "iconmanager.h" #include "scrspinbox.h" #include "units.h" #include "ui/marginpresetlayout.h" #include "ui/useprintermarginsdialog.h" -#include "scribusapp.h" +#include "scribusapp.h" NewMarginWidget::NewMarginWidget(QWidget* parent) : QWidget(parent) @@ -40,8 +41,8 @@ presetLayoutLabel->resize(0,0); presetLayoutComboBox->hide(); presetLayoutLabel->hide(); - horizontalLayout->removeWidget(presetLayoutComboBox); - horizontalLayout->removeWidget(presetLayoutLabel); + horizontalLayout->removeWidget(presetLayoutComboBox); + horizontalLayout->removeWidget(presetLayoutLabel); } if ((m_flags & ShowPrinterMargins) == 0) { @@ -48,14 +49,16 @@ printerMarginsPushButton->blockSignals(true); printerMarginsPushButton->resize(0,0); printerMarginsPushButton->hide(); - horizontalLayout->removeWidget(printerMarginsPushButton); + horizontalLayout->removeWidget(printerMarginsPushButton); } setFacingPages(!(layoutType == singlePage)); languageChange(); - iconSetChange(); + iconSetChange(); + toggleLabelVisibility(true); - connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); +// connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); connect(topMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setTop())); connect(bottomMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setBottom())); connect(leftMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setLeft())); @@ -75,7 +78,7 @@ rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the right margin guide and the edge of the page. If a double-sided, 3 or 4-fold layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>"); marginLinkButton->setToolTip( "<qt>" + tr( "Ensure all margins have the same value" ) + "</qt>"); } - else + else if (m_flags & BleedWidgetFlags) { topMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the top of the physical page" ) + "</qt>" ); bottomMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the bottom of the physical page" ) + "</qt>" ); @@ -83,16 +86,45 @@ rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the right of the physical page" ) + "</qt>"); marginLinkButton->setToolTip( "<qt>" + tr( "Ensure all bleeds have the same value" ) + "</qt>"); } + else + { + topMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the top" ) + "</qt>" ); + bottomMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the bottom" ) + "</qt>" ); + leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the left" ) + "</qt>" ); + rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the right" ) + "</qt>"); + marginLinkButton->setToolTip( "<qt>" + tr( "Ensure all distances have the same value" ) + "</qt>"); + } printerMarginsPushButton->setToolTip( "<qt>" + tr( "Import the margins for the selected page size from the available printers" ) + "</qt>"); - - leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left")); - rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right")); + + leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left")); + rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right")); } -void NewMarginWidget::iconSetChange() -{ -} - +void NewMarginWidget::iconSetChange() +{ + IconManager &im = IconManager::instance(); + + leftMarginLabel->setPixmap(im.loadPixmap(m_facingPages ? "border-inside" : "border-left")); + rightMarginLabel->setPixmap(im.loadPixmap(m_facingPages ? "border-outside" : "border-right")); + topMarginLabel->setPixmap(im.loadPixmap("border-top")); + bottomMarginLabel->setPixmap(im.loadPixmap("border-bottom")); +} + +void NewMarginWidget::toggleLabelVisibility(bool v) +{ + formWidget->setLabelVisibility(v); + leftMarginLabel->setLabelVisibility(v); + rightMarginLabel->setLabelVisibility(v); + topMarginLabel->setLabelVisibility(v); + bottomMarginLabel->setLabelVisibility(v); + + leftMarginLabel->setIconVisibility(!v); + rightMarginLabel->setIconVisibility(!v); + topMarginLabel->setIconVisibility(!v); + bottomMarginLabel->setIconVisibility(!v); + +} + void NewMarginWidget::setNewValues(const MarginStruct& margs) { m_marginData = m_savedMarginData = margs; @@ -101,24 +133,35 @@ void NewMarginWidget::setPageWidth(double newWidth) { - leftMarginSpinBox->setMaximum(qMax(0.0, newWidth * m_unitRatio - rightMarginSpinBox->value())); - rightMarginSpinBox->setMaximum(qMax(0.0, newWidth * m_unitRatio - leftMarginSpinBox->value())); + // if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + // { + leftMarginSpinBox->setMaximum(qMax(0.0, newWidth * m_unitRatio - rightMarginSpinBox->value())); + rightMarginSpinBox->setMaximum(qMax(0.0, newWidth * m_unitRatio - leftMarginSpinBox->value())); +// } m_pageWidth = newWidth; setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setPageHeight(double newHeight) { - topMarginSpinBox->setMaximum(qMax(0.0, newHeight * m_unitRatio - bottomMarginSpinBox->value())); - bottomMarginSpinBox->setMaximum(qMax(0.0,newHeight * m_unitRatio - topMarginSpinBox->value())); + // if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + // { + topMarginSpinBox->setMaximum(qMax(0.0, newHeight * m_unitRatio - bottomMarginSpinBox->value())); + bottomMarginSpinBox->setMaximum(qMax(0.0,newHeight * m_unitRatio - topMarginSpinBox->value())); +// } m_pageHeight = newHeight; setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setTop() { double newVal = topMarginSpinBox->value() / m_unitRatio; - bottomMarginSpinBox->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - topMarginSpinBox->value())); +// if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + bottomMarginSpinBox->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - topMarginSpinBox->value())); if (marginLinkButton->isChecked() && m_savedPresetItem == PresetLayout::none) { m_marginData.set(newVal, newVal, newVal, newVal); @@ -127,12 +170,15 @@ else m_marginData.setTop(newVal); setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setBottom() { double newVal = bottomMarginSpinBox->value() / m_unitRatio; - topMarginSpinBox->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - bottomMarginSpinBox->value())); +// if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + topMarginSpinBox->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - bottomMarginSpinBox->value())); if (marginLinkButton->isChecked() && m_savedPresetItem == PresetLayout::none) { m_marginData.set(newVal, newVal, newVal, newVal); @@ -141,12 +187,15 @@ else m_marginData.setBottom(newVal); setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setLeft() { double newVal = leftMarginSpinBox->value() / m_unitRatio; - rightMarginSpinBox->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - leftMarginSpinBox->value())); +// if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + rightMarginSpinBox->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - leftMarginSpinBox->value())); if (marginLinkButton->isChecked() && m_savedPresetItem == PresetLayout::none) { m_marginData.set(newVal, newVal, newVal, newVal); @@ -155,12 +204,15 @@ else m_marginData.setLeft(newVal); setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setRight() { double newVal = rightMarginSpinBox->value() / m_unitRatio; - leftMarginSpinBox->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - rightMarginSpinBox->value())); +// if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + leftMarginSpinBox->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - rightMarginSpinBox->value())); if (marginLinkButton->isChecked() && m_savedPresetItem == PresetLayout::none) { m_marginData.set(newVal, newVal, newVal, newVal); @@ -169,6 +221,8 @@ else m_marginData.setRight(newVal); setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setNewUnit(int newUnitIndex) @@ -242,8 +296,8 @@ topMarginSpinBox->blockSignals(false); bottomMarginSpinBox->blockSignals(false); m_savedPresetItem = item; - - emit marginChanged(m_marginData); + + emit marginChanged(m_marginData); } void NewMarginWidget::setPageSize(const QString& pageSize) @@ -284,8 +338,8 @@ rightMarginSpinBox->setValue(leftMarginSpinBox->value()); double newVal = leftMarginSpinBox->value() / m_unitRatio; m_marginData.set(newVal, newVal, newVal, newVal); - - emit marginChanged(m_marginData); + + emit marginChanged(m_marginData); } leftMarginSpinBox->blockSignals(leftBlocked); @@ -336,10 +390,10 @@ { m_facingPages = facing; m_pageType = pageType; - - leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left")); - rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right")); - + + leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left")); + rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right")); + setPreset(); } Index: scribus/ui/newmarginwidget.h =================================================================== --- scribus/ui/newmarginwidget.h (Revision 26312) +++ scribus/ui/newmarginwidget.h (Arbeitskopie) @@ -22,10 +22,11 @@ enum SetupFlags { - ShowPreset = 1, - ShowPrinterMargins = 2, - MarginWidgetFlags = 3, - BleedWidgetFlags = 4, + DistanceWidgetFlags = 0, + ShowPreset = 1, + ShowPrinterMargins = 2, + MarginWidgetFlags = 3, + BleedWidgetFlags = 4 }; void setup(const MarginStruct& margs, int layoutType, int unitIndex, int flags = MarginWidgetFlags); @@ -47,6 +48,7 @@ public slots: void languageChange(); void iconSetChange(); + void toggleLabelVisibility(bool v); void setTop(); void setBottom(); void setLeft(); @@ -74,6 +76,7 @@ signals: void marginChanged(MarginStruct); + void valuesChanged(MarginStruct); }; #endif // NEWMARGINWIDGET_H Index: scribus/ui/newmarginwidgetbase.ui =================================================================== --- scribus/ui/newmarginwidgetbase.ui (Revision 26312) +++ scribus/ui/newmarginwidgetbase.ui (Arbeitskopie) @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>180</width> - <height>186</height> + <width>164</width> + <height>182</height> </rect> </property> <property name="sizePolicy"> @@ -16,35 +16,38 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <layout class="QGridLayout" name="gridLayout"> + <layout class="QGridLayout" name="gridLayout"> <property name="leftMargin"> - <number>8</number> + <number>0</number> </property> <property name="topMargin"> - <number>8</number> + <number>0</number> </property> <property name="rightMargin"> - <number>8</number> + <number>0</number> </property> <property name="bottomMargin"> - <number>8</number> + <number>0</number> </property> - <property name="spacing"> - <number>4</number> - </property> - <item row="0" column="1" colspan="3"> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> + <property name="horizontalSpacing"> + <number>4</number> + </property> + <property name="verticalSpacing"> + <number>8</number> + </property> + <item row="0" column="1" colspan="3"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> <widget class="QLabel" name="presetLayoutLabel"> <property name="text"> - <string>Preset:</string> + <string>Preset:</string> </property> </widget> </item> - <item> - <widget class="PresetLayout" name="presetLayoutComboBox"> + <item> + <widget class="PresetLayout" name="presetLayoutComboBox"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -51,159 +54,159 @@ </property> </widget> </item> - <item> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Orientation::Horizontal</enum> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>0</width> - <height>0</height> - </size> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> </property> - </spacer> + </spacer> </item> - </layout> - </item> - <item row="1" column="2" rowspan="2"> - <widget class="FormWidget" name="formWidget"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="label" stdset="0"> - <string/> - </property> - <property name="font"> - <font> - <pointsize>8</pointsize> - </font> - </property> - <property name="preserveLabelSpace"> - <bool>true</bool> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="LinkButton" name="marginLinkButton"> - <property name="text"> - <string/> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="1" column="1"> - <widget class="FormWidget" name="leftMarginLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="label" stdset="0"> - <string>Left</string> - </property> - <property name="font"> - <font> - <pointsize>8</pointsize> - </font> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="ScrSpinBox" name="leftMarginSpinBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="2" column="1"> - <widget class="FormWidget" name="topMarginLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="label" stdset="0"> - <string>Top</string> - </property> - <property name="font"> - <font> - <pointsize>8</pointsize> - </font> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="ScrSpinBox" name="topMarginSpinBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="4" column="1" colspan="3"> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> + </layout> + </item> + <item row="1" column="2" rowspan="2"> + <widget class="FormWidget" name="formWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <property name="preserveLabelSpace"> + <bool>true</bool> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="LinkButton" name="marginLinkButton"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="1"> + <widget class="FormWidget" name="leftMarginLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Left</string> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="leftMarginSpinBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="2" column="1"> + <widget class="FormWidget" name="topMarginLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Top</string> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="topMarginSpinBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="4" column="1" colspan="3"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> <widget class="QPushButton" name="printerMarginsPushButton"> <property name="text"> <string>Printer Margins...</string> @@ -210,118 +213,118 @@ </property> </widget> </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Orientation::Horizontal</enum> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="sizeHint" stdset="0"> + <property name="sizeHint" stdset="0"> <size> - <width>0</width> + <width>0</width> <height>0</height> </size> </property> - </spacer> + </spacer> </item> </layout> </item> - <item row="2" column="3"> - <widget class="FormWidget" name="bottomMarginLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="label" stdset="0"> - <string>Bottom</string> - </property> - <property name="font"> - <font> - <pointsize>8</pointsize> - </font> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="ScrSpinBox" name="bottomMarginSpinBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="1" column="3"> - <widget class="FormWidget" name="rightMarginLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="label" stdset="0"> - <string>Right</string> - </property> - <property name="font"> - <font> - <pointsize>8</pointsize> - </font> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="ScrSpinBox" name="rightMarginSpinBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - </layout> - </widget> - </item> + <item row="2" column="3"> + <widget class="FormWidget" name="bottomMarginLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Bottom</string> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="bottomMarginSpinBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="3"> + <widget class="FormWidget" name="rightMarginLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Right</string> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + </font> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="rightMarginSpinBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </widget> <customwidgets> <customwidget> - <class>FormWidget</class> - <extends>QWidget</extends> - <header>ui/widgets/form_widget.h</header> - <container>1</container> - </customwidget> - <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + <customwidget> <class>ScrSpinBox</class> <extends>QDoubleSpinBox</extends> - <header location="global">ui/scrspinbox.h</header> + <header location="global">ui/scrspinbox.h</header> </customwidget> <customwidget> <class>LinkButton</class> @@ -339,7 +342,7 @@ <tabstop>leftMarginSpinBox</tabstop> <tabstop>rightMarginSpinBox</tabstop> <tabstop>topMarginSpinBox</tabstop> - <tabstop>marginLinkButton</tabstop> + <tabstop>marginLinkButton</tabstop> <tabstop>bottomMarginSpinBox</tabstop> <tabstop>printerMarginsPushButton</tabstop> </tabstops> Index: scribus/ui/pagepalette_widgets.h =================================================================== --- scribus/ui/pagepalette_widgets.h (Revision 26312) +++ scribus/ui/pagepalette_widgets.h (Arbeitskopie) @@ -80,9 +80,9 @@ struct SCRIBUS_API PageCell { - QString pageName {QString()}; + QString pageName {QString()}; + uint pageNumber {1}; QString pageNumberDisplay; - uint pageNumber {1}; QPixmap pagePreview {QPixmap()}; QColor masterPageColor {QColor()}; double pageRatio {1.4142}; // IsoA Index: scribus/ui/prefs_documentsections.cpp =================================================================== --- scribus/ui/prefs_documentsections.cpp (Revision 26312) +++ scribus/ui/prefs_documentsections.cpp (Arbeitskopie) @@ -25,7 +25,7 @@ languageChange(); m_caption = tr("Sections"); - m_icon = "tabtocindex_16.png"; + m_icon = "section"; connect(sectionsTable, SIGNAL(cellChanged(int,int)), this, SLOT(tableItemChanged(int,int))); connect(addButton, SIGNAL(clicked()), this, SLOT(addEntry())); Index: scribus/ui/propertiespalette_line.cpp =================================================================== --- scribus/ui/propertiespalette_line.cpp (Revision 26312) +++ scribus/ui/propertiespalette_line.cpp (Arbeitskopie) @@ -23,6 +23,7 @@ #include "scribusapp.h" #include "scribusdoc.h" #include "selection.h" +#include "stylemanager.h" #include "ui/colorpicker/colorpicker_enum.h" #include "ui/widgets/popup_menu.h" #include "units.h" @@ -84,6 +85,8 @@ connect(buttonSwapMarker, SIGNAL(clicked(bool)), this, SLOT(swapLineMarker())); connect(comboBlendmode, SIGNAL(currentIndexChanged(int)), this, SLOT(handleLineBlendmode(int))); connect(comboLineStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(handleLineStyle(int))); + connect(buttonLineStyleNew, SIGNAL(clicked(bool)), this, SLOT(handleLineStyleNew())); + connect(buttonLineStyleEdit, SIGNAL(clicked(bool)), this, SLOT(handleLineStyleEdit())); connect(buttonLineColor, SIGNAL(changed()), this, SLOT(handleLineColor())); connect(buttonLineColor, SIGNAL(gradientVectorChanged()), this, SLOT(handleLineColorVector())); connect(buttonLineMask, SIGNAL(changed()), this, SLOT(handleLineOpacity())); @@ -304,6 +307,8 @@ comboLineStyle->setCurrentText(m_item->NamedLStyle); } + buttonLineStyleEdit->setEnabled(comboLineStyle->currentIndex() != 0); + lineTypeLabel->setVisible(!hasStyle); lineWidthLabel->setVisible(!hasStyle); lineJoinLabel->setVisible(!hasStyle); @@ -669,8 +674,27 @@ return; bool setter = (c == 0); m_doc->itemSelection_SetNamedLineStyle(setter ? QString("") : comboLineStyle->currentText()); + + buttonLineStyleEdit->setEnabled(comboLineStyle->currentIndex() != 0); } +void PropertiesPalette_Line::handleLineStyleNew() +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + + m_ScMW->styleMgr()->showAsNewLineStyle(); +} + +void PropertiesPalette_Line::handleLineStyleEdit() +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + + if (comboLineStyle->currentIndex() != 0) + m_ScMW->styleMgr()->showAsEditLineStyle(comboLineStyle->currentText()); +} + void PropertiesPalette_Line::handleLineOpacity(/*double opacity*/) { if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning()) @@ -842,6 +866,10 @@ buttonSwapMarker->setIcon(im.loadIcon("swap")); buttonLineMask->setDotIcon(im.loadIcon("mask", 8)); + lineStyleLabel->setPixmap(im.loadPixmap("stroke-style")); + buttonLineStyleNew->setIcon(im.loadIcon("stroke-style-new")); + buttonLineStyleEdit->setIcon(im.loadIcon("stroke-style-edit")); + } void PropertiesPalette_Line::languageChange() Index: scribus/ui/propertiespalette_line.h =================================================================== --- scribus/ui/propertiespalette_line.h (Revision 26312) +++ scribus/ui/propertiespalette_line.h (Arbeitskopie) @@ -85,6 +85,8 @@ void handleLineWidth(); void handleLineType(); void handleLineStyle(int c); + void handleLineStyleNew(); + void handleLineStyleEdit(); void handleLineJoin(); void handleLineEnd(); void handleDashChange(); Index: scribus/ui/propertiespalette_linebase.ui =================================================================== --- scribus/ui/propertiespalette_linebase.ui (Revision 26312) +++ scribus/ui/propertiespalette_linebase.ui (Arbeitskopie) @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>315</width> - <height>235</height> + <width>315</width> + <height>235</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> @@ -28,17 +28,83 @@ </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_11"> + <property name="spacing"> + <number>4</number> + </property> <item> - <widget class="ComboLineStyle" name="comboLineStyle"> - <property name="sizeAdjustPolicy"> - <enum>QComboBox::AdjustToContents</enum> + <widget class="FormWidget" name="lineStyleLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_14"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ComboLineStyle" name="comboLineStyle"> + <property name="sizeAdjustPolicy"> + <enum>QComboBox::SizeAdjustPolicy::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> </widget> </item> <item> + <widget class="QToolButton" name="buttonLineStyleEdit"> + <property name="toolTip"> + <string>Edit current selected line style</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Policy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>8</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QToolButton" name="buttonLineStyleNew"> + <property name="toolTip"> + <string>Add new line style</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> <spacer name="horizontalSpacer_4"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -84,7 +150,7 @@ <string/> </property> <property name="popupMode"> - <enum>QToolButton::InstantPopup</enum> + <enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum> </property> </widget> </item> @@ -198,7 +264,7 @@ </size> </property> <property name="popupMode"> - <enum>QToolButton::InstantPopup</enum> + <enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum> </property> </widget> </item> @@ -221,7 +287,7 @@ </size> </property> <property name="popupMode"> - <enum>QToolButton::InstantPopup</enum> + <enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum> </property> </widget> </item> @@ -231,7 +297,7 @@ <item> <spacer name="horizontalSpacer_2"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -328,7 +394,7 @@ <item> <spacer name="horizontalSpacer"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -343,10 +409,10 @@ <item> <widget class="DashEditor" name="dashEditor"> <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> + <enum>QFrame::Shape::StyledPanel</enum> </property> <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <enum>QFrame::Shadow::Raised</enum> </property> </widget> </item> @@ -479,7 +545,7 @@ <item> <spacer name="horizontalSpacer_3"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -501,16 +567,16 @@ <container>1</container> </customwidget> <customwidget> - <class>ScrSpinBox</class> - <extends>QDoubleSpinBox</extends> - <header>ui/scrspinbox.h</header> - </customwidget> - <customwidget> <class>ColorButton</class> <extends>QToolButton</extends> <header>ui/widgets/color_button.h</header> </customwidget> <customwidget> + <class>ScrSpinBox</class> + <extends>QDoubleSpinBox</extends> + <header location="global">ui/scrspinbox.h</header> + </customwidget> + <customwidget> <class>LineCombo</class> <extends>QComboBox</extends> <header>ui/linecombo.h</header> @@ -533,7 +599,6 @@ </customwidget> </customwidgets> <tabstops> - <tabstop>comboLineStyle</tabstop> <tabstop>buttonLineColor</tabstop> <tabstop>buttonLineMask</tabstop> <tabstop>comboBlendmode</tabstop> Index: scribus/ui/propertiespalette_shadow.cpp =================================================================== --- scribus/ui/propertiespalette_shadow.cpp (Revision 26312) +++ scribus/ui/propertiespalette_shadow.cpp (Arbeitskopie) @@ -282,21 +282,6 @@ labelErase->setLabelVisibility(v); } -//void PropertiesPalette_Shadow::updateColorList() -//{ -// if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning()) -// return; -// disconnectSlots(); - -//// colorPicker->loadLists(); - -//// QString color = colorPicker->colorName(); -//// colorPicker->setColors(m_doc->PageColors); -//// colorPicker->setColor(color); - -// connectSlots(); -//} - void PropertiesPalette_Shadow::handleNewValues() { if (!m_haveItem || !m_haveDoc) Index: scribus/ui/propertiespalette_text.cpp =================================================================== --- scribus/ui/propertiespalette_text.cpp (Revision 26312) +++ scribus/ui/propertiespalette_text.cpp (Arbeitskopie) @@ -18,27 +18,24 @@ #include "commonstrings.h" #include "fontcombo.h" #include "iconmanager.h" -#include "localemgr.h" #include "pageitem.h" #include "pageitem_table.h" #include "pageitem_textframe.h" #include "propertywidget_advanced.h" +#include "propertywidget_alignment.h" #include "propertywidget_distance.h" -#include "propertywidget_flop.h" #include "propertywidget_fontfeatures.h" #include "propertywidget_hyphenation.h" -#include "propertywidget_optmargins.h" #include "propertywidget_orphans.h" +#include "propertywidget_paragraphstyle.h" #include "propertywidget_pareffect.h" #include "propertywidget_pathtext.h" #include "propertywidget_text.h" -#include "propertywidget_textcolor.h" #include "scribus.h" #include "scribusapp.h" #include "selection.h" #include "stylecombos.h" #include "undomanager.h" -#include "langmgr.h" #include "widgets/section_container.h" //using namespace std; @@ -45,31 +42,46 @@ PropertiesPalette_Text::PropertiesPalette_Text( QWidget* parent) : QWidget(parent) { + // Character + scCharacter = new SectionContainer(tr("Character"), "SectionTXCharacter", false, false); + scCharacter->setHeaderType(SectionContainerHeader::Header); + scCharacter->setHeaderSize(SectionContainerHeader::Large); + characterStyleWidgets = new PropertyWidget_ParagraphStyle(); + characterStyleWidgets->hideParagraphStyle(true); + + textWidgets = new PropertyWidget_Text(this); + scText = new SectionContainer(tr("Font"), "SectionTXFont", true, true); + scText->setCanSaveState(true); + scText->setWidget(textWidgets); + scText->restorePreferences(); + advancedWidgets = new PropertyWidget_Advanced(this); - scAdvanced = new SectionContainer(tr("Advanced Settings"), "SectionTXAdvanced", true, false); + scAdvanced = new SectionContainer(tr("Typography"), "SectionTXTypography", true, false); scAdvanced->setCanSaveState(true); - scAdvanced->setWidget(advancedWidgets); + scAdvanced->setWidget(advancedWidgets); scAdvanced->restorePreferences(); - distanceWidgets = new PropertyWidget_Distance(this); - scDistance = new SectionContainer(tr("Columns && Text Distances"), "SectionTXColDist", true, false); - scDistance->setCanSaveState(true); - scDistance->setWidget(distanceWidgets); - scDistance->restorePreferences(); - - flopBox = new PropertyWidget_Flop(this); - scFlop = new SectionContainer(tr("First Line Offset"), "SectionTXLineOffset", true, false); - scFlop->setCanSaveState(true); - scFlop->setWidget(flopBox); - scFlop->restorePreferences(); - fontfeaturesWidget = new PropertyWidget_FontFeatures(this); - scFontFeatures = new SectionContainer(tr("Font Features"), "SectionTXFontFeatures", true, false); + scFontFeatures = new SectionContainer(tr("OpenType Features"), "SectionTXOpenTypeFeatures", true, false); scFontFeatures->setCanSaveState(true); scFontFeatures->setWidget(fontfeaturesWidget); scFontFeatures->restorePreferences(); + // Paragraph + scParagraph = new SectionContainer(tr("Paragraph"), "SectionTXParagraph", false, false); + scParagraph->setHeaderType(SectionContainerHeader::Header); + scParagraph->setHeaderSize(SectionContainerHeader::Large); + + paragraphStyleWidgets = new PropertyWidget_ParagraphStyle(this); + paragraphStyleWidgets->hideCharacterStyle(true); + + alignmentWidgets = new PropertyWidget_Alignment(this); + scAlignment = new SectionContainer(tr("Alignment && Tabs"), "SectionTXAlignment", true, true); + scAlignment->setCanSaveState(true); + scAlignment->setWidget(alignmentWidgets); + scAlignment->restorePreferences(); + hyphenationWidget = new PropertyWidget_Hyphenation(this); scHyphenation = new SectionContainer(tr("Hyphenation"), "SectionTXHyphenation", true, false); scHyphenation->setCanSaveState(true); @@ -76,69 +88,66 @@ scHyphenation->setWidget(hyphenationWidget); scHyphenation->restorePreferences(); - optMargins = new PropertyWidget_OptMargins(this); - scOptMargins = new SectionContainer(tr("Optical Margins"), "SectionTXMargins", true, false); - scOptMargins->setCanSaveState(true); - scOptMargins->setWidget(optMargins); - scOptMargins->restorePreferences(); - orphanBox = new PropertyWidget_Orphans(this); - scOrphans = new SectionContainer(tr("Orphans and Widows"), "SectionTXOrphansWidow", true, false); + scOrphans = new SectionContainer(tr("Orphans && Widows"), "SectionTXOrphansWidows", true, false); scOrphans->setCanSaveState(true); scOrphans->setWidget(orphanBox); scOrphans->restorePreferences(); parEffectWidgets = new PropertyWidget_ParEffect(this); - scParEffect = new SectionContainer(tr("Paragraph Effects"), "SectionTXEffects", true, false); + scParEffect = new SectionContainer(tr("Lists && Drop Caps"), "SectionTXLists", true, false); scParEffect->setCanSaveState(true); scParEffect->setWidget(parEffectWidgets); scParEffect->restorePreferences(); + // Layout + scLayout = new SectionContainer(tr("Layout"), "SectionTXLayout", false, false); + scLayout->setHeaderType(SectionContainerHeader::Header); + scLayout->setHeaderSize(SectionContainerHeader::Large); + + distanceWidgets = new PropertyWidget_Distance(this); + scDistance = new SectionContainer(tr("Columns && Margins"), "SectionTXColumnsMargins", true, false); + scDistance->setCanSaveState(true); + scDistance->setWidget(distanceWidgets); + scDistance->restorePreferences(); + pathTextWidgets = new PropertyWidget_PathText(this); - scPathText = new SectionContainer(tr("Path Text Properties"), "SectionTXPathText", true, false); + scPathText = new SectionContainer(tr("Text on Path"), "SectionTXTextOnPath", true, false); scPathText->setCanSaveState(true); scPathText->setWidget(pathTextWidgets); scPathText->restorePreferences(); - textWidgets = new PropertyWidget_Text(this); - scText = new SectionContainer(tr("Text"), "SectionTXText", true, true); - scText->setCanSaveState(true); - scText->setWidget(textWidgets); - scText->restorePreferences(); - - colorWidgets = new PropertyWidget_TextColor(this); - scTextColor = new SectionContainer(tr("Color && Effects"), "SectionTXColorEffects", true, false); - scTextColor->setCanSaveState(true); - scTextColor->setWidget(colorWidgets); - scTextColor->restorePreferences(); - // Layout stack QVBoxLayout * lyt = new QVBoxLayout(); lyt->setContentsMargins(0, 0, 0, 0); lyt->setSpacing(0); - lyt->addWidget(scText); - lyt->addWidget(scTextColor); - lyt->addWidget(scFlop); + + lyt->addWidget(scCharacter); + lyt->addWidget(characterStyleWidgets); + lyt->addWidget(scText); + lyt->addWidget(scAdvanced); + lyt->addWidget(scFontFeatures); + + lyt->addWidget(scParagraph); + lyt->addWidget(paragraphStyleWidgets); + lyt->addWidget(scAlignment); + lyt->addWidget(scHyphenation); lyt->addWidget(scOrphans); lyt->addWidget(scParEffect); + + lyt->addWidget(scLayout); lyt->addWidget(scDistance); - lyt->addWidget(scOptMargins); - lyt->addWidget(scHyphenation); - lyt->addWidget(scAdvanced); - lyt->addWidget(scFontFeatures); lyt->addWidget(scPathText); lyt->addStretch(1); + setLayout(lyt); - + setEnabled(false); iconSetChange(); languageChange(); - connect(flopBox->flopGroup, SIGNAL(idClicked(int)), this, SLOT(handleFirstLinePolicy(int))); - connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); - setEnabled(false); } void PropertiesPalette_Text::setMainWindow(ScribusMainWindow* mw) @@ -147,12 +156,13 @@ textWidgets->setMainWindow(mw); advancedWidgets->setMainWindow(mw); + alignmentWidgets->setMainWindow(mw); fontfeaturesWidget->setMainWindow(mw); - colorWidgets->setMainWindow(mw); distanceWidgets->setMainWindow(mw); hyphenationWidget->setMainWindow(mw); + paragraphStyleWidgets->setMainWindow(mw); + characterStyleWidgets->setMainWindow(mw); parEffectWidgets->setMainWindow(mw); - optMargins->setMainWindow(mw); pathTextWidgets->setMainWindow(mw); connect(m_ScMW, SIGNAL(UpdateRequest(int)) , this , SLOT(handleUpdateRequest(int))); @@ -180,13 +190,13 @@ textWidgets->setDoc(m_doc); advancedWidgets->setDoc(m_doc); + alignmentWidgets->setDoc(m_doc); fontfeaturesWidget->setDoc(m_doc); - colorWidgets->setDoc(m_doc); distanceWidgets->setDoc(m_doc); parEffectWidgets->setDoc(m_doc); - flopBox->setDoc(m_doc); hyphenationWidget->setDoc(m_doc); - optMargins->setDoc(m_doc); + paragraphStyleWidgets->setDoc(m_doc); + characterStyleWidgets->setDoc(m_doc); orphanBox->setDoc(m_doc); pathTextWidgets->setDoc(m_doc); @@ -209,12 +219,12 @@ textWidgets->setDoc(nullptr); advancedWidgets->setDoc(nullptr); + alignmentWidgets->setDoc(nullptr); fontfeaturesWidget->setDoc(nullptr); - colorWidgets->setDoc(nullptr); distanceWidgets->setDoc(nullptr); - flopBox->setDoc(nullptr); hyphenationWidget->setDoc(nullptr); - optMargins->setDoc(nullptr); + paragraphStyleWidgets->setDoc(nullptr); + characterStyleWidgets->setDoc(nullptr); orphanBox->setDoc(nullptr); parEffectWidgets->setDoc(nullptr); pathTextWidgets->setDoc(nullptr); @@ -226,7 +236,6 @@ { m_haveItem = false; m_item = nullptr; - colorWidgets->setCurrentItem(m_item); handleSelectionChanged(); } @@ -256,7 +265,6 @@ if (m_doc->m_Selection->count() > 1) { setEnabled(false); - flopBox->flopRealHeight->setChecked(true); } else { @@ -291,29 +299,16 @@ void PropertiesPalette_Text::handleUpdateRequest(int updateFlags) { - // ColorWidget will handle its update itself - /*if (updateFlags & reqColorsUpdate) - updateColorList();*/ - textWidgets->handleUpdateRequest(updateFlags); + paragraphStyleWidgets->handleUpdateRequest(updateFlags); + characterStyleWidgets->handleUpdateRequest(updateFlags); if (updateFlags & reqCharStylesUpdate) - { -// charStyleCombo->updateStyleList(); parEffectWidgets->updateCharStyles(); - } -// if (updateFlags & reqParaStylesUpdate) -// paraStyleCombo->updateStyleList(); -// if (updateFlags & reqDefFontListUpdate) -// fonts->rebuildList(nullptr); -// if (updateFlags & reqDocFontListUpdate) -// fonts->rebuildList(m_haveDoc ? m_doc : nullptr); + if (updateFlags & reqStyleComboDocUpdate) - { -// paraStyleCombo->setDoc(m_haveDoc ? m_doc : nullptr); -// charStyleCombo->setDoc(m_haveDoc ? m_doc : nullptr); parEffectWidgets->setDoc(m_haveDoc ? m_doc : nullptr); - } + } void PropertiesPalette_Text::setCurrentItem(PageItem *item) @@ -333,8 +328,6 @@ m_haveItem = false; m_item = item; - showFirstLinePolicy(m_item->firstLineOffset()); - if ((m_item->isGroup()) && (!m_item->isSingleSel)) { setEnabled(false); @@ -344,7 +337,7 @@ if (!sender()) { - colorWidgets->handleSelectionChanged(); + alignmentWidgets->handleSelectionChanged(); distanceWidgets->handleSelectionChanged(); parEffectWidgets->handleSelectionChanged(); } @@ -368,7 +361,7 @@ void PropertiesPalette_Text::iconSetChange() { - textWidgets->iconSetChange(); + // no local icons to change } void PropertiesPalette_Text::unitChange() @@ -379,11 +372,9 @@ m_haveItem = false; advancedWidgets->unitChange(); + alignmentWidgets->unitChange(); fontfeaturesWidget->unitChange(); - colorWidgets->unitChange(); distanceWidgets->unitChange(); - flopBox->unitChange(); - optMargins->unitChange(); pathTextWidgets->unitChange(); parEffectWidgets->unitChange(); textWidgets->unitChange(); @@ -393,12 +384,7 @@ void PropertiesPalette_Text::localeChange() { - textWidgets->localeChange(); - advancedWidgets->localeChange(); - colorWidgets->localeChange(); - distanceWidgets->localeChange(); - parEffectWidgets->localeChange(); - pathTextWidgets->localeChange(); + // Nothing to do here! } void PropertiesPalette_Text::showFontSize(double s) @@ -408,21 +394,9 @@ void PropertiesPalette_Text::showLanguage(const QString& w) { - textWidgets->showLanguage(w); + hyphenationWidget->showLanguage(w); } -void PropertiesPalette_Text::showFirstLinePolicy( FirstLineOffsetPolicy f ) -{ - if (f == FLOPFontAscent) - flopBox->flopFontAscent->setChecked(true); - else if (f == FLOPLineSpacing) - flopBox->flopLineSpacing->setChecked(true); - else if (f == FLOPRealGlyphHeight) - flopBox->flopRealHeight->setChecked(true); //It’s historical behaviour. - else // if (f == FLOPBaseline) - flopBox->flopBaselineGrid->setChecked(true); -} - void PropertiesPalette_Text::updateCharStyle(const CharStyle& charStyle) { if (!m_ScMW || m_ScMW->scriptIsRunning()) @@ -430,7 +404,6 @@ advancedWidgets->updateCharStyle(charStyle); fontfeaturesWidget->updateCharStyle(charStyle); - colorWidgets->updateCharStyle(charStyle); hyphenationWidget->updateCharStyle(charStyle); textWidgets->updateCharStyle(charStyle); } @@ -442,49 +415,44 @@ advancedWidgets->updateStyle(newCurrent); fontfeaturesWidget->updateStyle(newCurrent); - colorWidgets->updateStyle(newCurrent); - optMargins->updateStyle(newCurrent); orphanBox->updateStyle (newCurrent); parEffectWidgets->updateStyle(newCurrent); hyphenationWidget->updateStyle(newCurrent); textWidgets->updateStyle(newCurrent); + paragraphStyleWidgets->updateStyle(newCurrent); + characterStyleWidgets->updateStyle(newCurrent); } void PropertiesPalette_Text::updateCharStyles() { - textWidgets->updateCharStyles(); parEffectWidgets->updateCharStyles(); + paragraphStyleWidgets->updateCharStyles(); + characterStyleWidgets->updateCharStyles(); } void PropertiesPalette_Text::updateParagraphStyles() { - textWidgets->updateParagraphStyles(); parEffectWidgets->updateCharStyles(); + paragraphStyleWidgets->updateCharStyles(); + characterStyleWidgets->updateCharStyles(); } void PropertiesPalette_Text::updateTextStyles() { - textWidgets->updateTextStyles(); + paragraphStyleWidgets->updateTextStyles(); + characterStyleWidgets->updateTextStyles(); } void PropertiesPalette_Text::showAlignment(int e) { - textWidgets->showAlignment(e); + alignmentWidgets->showAlignment(e); } void PropertiesPalette_Text::showDirection(int e) { - textWidgets->showDirection(e); + alignmentWidgets->showDirection(e); } -void PropertiesPalette_Text::updateColorList() -{ - if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - - colorWidgets->updateColorList(); -} - void PropertiesPalette_Text::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) @@ -497,46 +465,24 @@ void PropertiesPalette_Text::languageChange() { - scAdvanced->setText(tr("Advanced Settings")); - scDistance->setText(tr("Columns && Text Distances")); - scFlop->setText(tr("First Line Offset")); - scFontFeatures->setText(tr("Font Features")); + scAdvanced->setText(tr("Typography")); + scAlignment->setText(tr("Alignment && Tabs")); + scDistance->setText(tr("Columns && Margins")); + scFontFeatures->setText(tr("OpenType Features")); scHyphenation->setText(tr("Hyphenation")); - scOptMargins->setText(tr("Optical Margins")); - scOrphans->setText(tr("Orphans and Widows")); - scParEffect->setText(tr("Paragraph Effects")); - scPathText->setText(tr("Path Text Properties")); - scText->setText(tr("Text")); - scTextColor->setText(tr("Color && Effects")); + scOrphans->setText(tr("Orphans && Widows")); + scParEffect->setText(tr("Lists && Drop Caps")); + scPathText->setText(tr("Text on Path")); + scText->setText(tr("Font")); - colorWidgets->languageChange(); - flopBox->languageChange(); orphanBox->languageChange(); distanceWidgets->languageChange(); - optMargins->languageChange(); advancedWidgets->languageChange(); + alignmentWidgets->languageChange(); pathTextWidgets->languageChange(); fontfeaturesWidget->languageChange(); hyphenationWidget->languageChange(); textWidgets->languageChange(); + paragraphStyleWidgets->languageChange(); + characterStyleWidgets->languageChange(); } - -void PropertiesPalette_Text::handleFirstLinePolicy(int radioFlop) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveDoc || !m_haveItem) - return; - if (radioFlop == PropertyWidget_Flop::RealHeightID) - m_item->setFirstLineOffset(FLOPRealGlyphHeight); - else if (radioFlop == PropertyWidget_Flop::FontAscentID) - m_item->setFirstLineOffset(FLOPFontAscent); - else if (radioFlop == PropertyWidget_Flop::LineSpacingID) - m_item->setFirstLineOffset(FLOPLineSpacing); - else if (radioFlop == PropertyWidget_Flop::BaselineGridID) - m_item->setFirstLineOffset(FLOPBaselineGrid); - m_item->update(); - if (m_doc->appMode == modeEditTable) - m_item->parentTable()->update(); - else - m_item->update(); - m_doc->regionsChanged()->update(QRect()); -} Index: scribus/ui/propertiespalette_text.h =================================================================== --- scribus/ui/propertiespalette_text.h (Revision 26312) +++ scribus/ui/propertiespalette_text.h (Arbeitskopie) @@ -7,10 +7,8 @@ #ifndef PROPERTIESPALETTE_TEXT_H #define PROPERTIESPALETTE_TEXT_H +#include <QWidget> #include "scribusapi.h" -#include "scrpalettebase.h" -#include "scrspinbox.h" - #include "scguardedptr.h" #include "sctextstruct.h" #include "units.h" @@ -17,22 +15,21 @@ class PageItem; class PropertyWidget_Advanced; +class PropertyWidget_Alignment; class PropertyWidget_Distance; +class PropertyWidget_ParagraphStyle; class PropertyWidget_ParEffect; -class PropertyWidget_Flop; class PropertyWidget_FontFeatures; class PropertyWidget_Hyphenation; -class PropertyWidget_OptMargins; class PropertyWidget_Orphans; class PropertyWidget_PathText; -class PropertyWidget_Text; -class PropertyWidget_TextColor; -class SectionContainer; +class PropertyWidget_Text; +class SectionContainer; class ScribusDoc; class ScribusMainWindow; class Selection; -class SCRIBUS_API PropertiesPalette_Text : public QWidget +class SCRIBUS_API PropertiesPalette_Text : public QWidget { Q_OBJECT @@ -40,7 +37,7 @@ PropertiesPalette_Text(QWidget* parent); ~PropertiesPalette_Text() {} - void updateColorList(); + //void updateColorList(); /** @brief Returns true if there is a user action going on at the moment of call. */ bool userActionOn(); // not yet implemented!!! This is needed badly. @@ -81,44 +78,42 @@ void showDirection(int e); void showFontSize(double s); void showLanguage(const QString& w); - void showFirstLinePolicy(FirstLineOffsetPolicy); - + /// update TB values: void updateCharStyle(const CharStyle& charStyle); - void updateStyle(const ParagraphStyle& newCurrent); + void updateStyle(const ParagraphStyle& newCurrent); void updateCharStyles(); void updateParagraphStyles(); - void updateTextStyles(); + void updateTextStyles(); -private slots: - - void handleFirstLinePolicy(int); - protected: PropertyWidget_Advanced* advancedWidgets; + PropertyWidget_Alignment* alignmentWidgets; PropertyWidget_Distance* distanceWidgets; - PropertyWidget_Flop* flopBox; PropertyWidget_FontFeatures* fontfeaturesWidget; PropertyWidget_Hyphenation* hyphenationWidget; - PropertyWidget_OptMargins* optMargins; PropertyWidget_Orphans* orphanBox; + PropertyWidget_ParagraphStyle* paragraphStyleWidgets; + PropertyWidget_ParagraphStyle* characterStyleWidgets; PropertyWidget_ParEffect* parEffectWidgets; PropertyWidget_PathText* pathTextWidgets; - PropertyWidget_Text* textWidgets; - PropertyWidget_TextColor* colorWidgets; + PropertyWidget_Text* textWidgets; - SectionContainer * scAdvanced = {nullptr}; - SectionContainer * scDistance = {nullptr}; - SectionContainer * scFlop = {nullptr}; - SectionContainer * scFontFeatures = {nullptr}; - SectionContainer * scHyphenation = {nullptr}; - SectionContainer * scOptMargins = {nullptr}; - SectionContainer * scOrphans = {nullptr}; - SectionContainer * scParEffect = {nullptr}; - SectionContainer * scPathText = {nullptr}; - SectionContainer * scText = {nullptr}; - SectionContainer * scTextColor = {nullptr}; + SectionContainer * scCharacter = {nullptr}; + SectionContainer * scParagraph = {nullptr}; + SectionContainer * scLayout = {nullptr}; + SectionContainer * scAdvanced = {nullptr}; + SectionContainer * scAlignment = {nullptr}; + SectionContainer * scDistance = {nullptr}; + SectionContainer * scFontFeatures = {nullptr}; + SectionContainer * scHyphenation = {nullptr}; + SectionContainer * scOrphans = {nullptr}; + SectionContainer * scParEffect = {nullptr}; + SectionContainer * scPathText = {nullptr}; + SectionContainer * scText = {nullptr}; + SectionContainer * scTextColor = {nullptr}; + }; #endif Index: scribus/ui/propertywidget_advanced.cpp =================================================================== --- scribus/ui/propertywidget_advanced.cpp (Revision 26312) +++ scribus/ui/propertywidget_advanced.cpp (Arbeitskopie) @@ -27,17 +27,17 @@ scaleH->setValues(10, 400, 2, 100); scaleV->setValues(10, 400, 2, 100); - minWordTrackingLabel->setBuddy(minWordTrackingSpinBox); - normWordTrackingLabel->setBuddy(normWordTrackingSpinBox); + buttonOutlineColor->setContext(Context::TextOutline); + buttonOutlineColor->setMenuContextType(ColorButton::Floating); + buttonOutlineColor->setColor(CommonStrings::tr_NoneColor); + buttonOutlineColor->setIconSize(QSize(20, 20)); - minGlyphExtensionLabel->setBuddy(minGlyphExtSpinBox); - maxGlyphExtensionLabel->setBuddy(maxGlyphExtSpinBox); - iconSetChange(); languageChange(); connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void PropertyWidget_Advanced::setMainWindow(ScribusMainWindow *mw) @@ -72,7 +72,8 @@ minWordTrackingSpinBox->setValues(1, 100, 2, 100); normWordTrackingSpinBox->setValues(1, 2000, 2, 100); minGlyphExtSpinBox->setValues(90, 110, 2, 100); - maxGlyphExtSpinBox->setValues(90, 110, 2, 100); + maxGlyphExtSpinBox->setValues(90, 110, 2, 100); + buttonOutlineColor->setDoc(m_doc); connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); connect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); @@ -120,6 +121,17 @@ connect(normWordTrackingSpinBox, SIGNAL(valueChanged(double)), this, SLOT(handleNormWordTracking()) ); connect(minGlyphExtSpinBox , SIGNAL(valueChanged(double)), this, SLOT(handleMinGlyphExtension()) ); connect(maxGlyphExtSpinBox , SIGNAL(valueChanged(double)), this, SLOT(handleMaxGlyphExtension()) ); + + connect(textEffects, SIGNAL(State(int)) , this, SLOT(handleTypeStyle(int)), Qt::UniqueConnection); + connect(textEffects->ShadowVal->Xoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs()), Qt::UniqueConnection); + connect(textEffects->ShadowVal->Yoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs()), Qt::UniqueConnection); + connect(textEffects->OutlineVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleOutlineWidth()), Qt::UniqueConnection); + connect(textEffects->UnderlineVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleUnderline()) , Qt::UniqueConnection); + connect(textEffects->UnderlineVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleUnderline()) , Qt::UniqueConnection); + connect(textEffects->StrikeVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru()), Qt::UniqueConnection); + connect(textEffects->StrikeVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru()), Qt::UniqueConnection); + + connect(buttonOutlineColor, SIGNAL(changed()), this, SLOT(handleTextOutline())); } void PropertyWidget_Advanced::disconnectSignals() @@ -132,6 +144,17 @@ disconnect(normWordTrackingSpinBox, SIGNAL(valueChanged(double)), this, SLOT(handleNormWordTracking()) ); disconnect(minGlyphExtSpinBox , SIGNAL(valueChanged(double)), this, SLOT(handleMinGlyphExtension()) ); disconnect(maxGlyphExtSpinBox , SIGNAL(valueChanged(double)), this, SLOT(handleMaxGlyphExtension()) ); + + disconnect(textEffects, SIGNAL(State(int)) , this, SLOT(handleTypeStyle(int))); + disconnect(textEffects->ShadowVal->Xoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs())); + disconnect(textEffects->ShadowVal->Yoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs())); + disconnect(textEffects->OutlineVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleOutlineWidth())); + disconnect(textEffects->UnderlineVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleUnderline())); + disconnect(textEffects->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(handleUnderline())); + disconnect(textEffects->StrikeVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru())); + disconnect(textEffects->StrikeVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru())); + + disconnect(buttonOutlineColor, SIGNAL(changed()), this, SLOT(handleTextOutline())); } void PropertyWidget_Advanced::configureWidgets() @@ -189,6 +212,57 @@ tracking->showValue(e / 10.0); } +void PropertyWidget_Advanced::showTextColors(const QString& strokeCol, double strokeShd) +{ + + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning() || m_blockUpdate) + return; + + buttonOutlineColor->setColor(strokeCol, qRound(strokeShd)); + buttonOutlineColor->updatePreview(); + buttonOutlineColor->updateFloatingContext(); +} + +void PropertyWidget_Advanced::showOutlineW(double x) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + textEffects->OutlineVal->LWidth->showValue(x / 10.0); +} + +void PropertyWidget_Advanced::showShadowOffset(double x, double y) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + textEffects->ShadowVal->Xoffset->showValue(x / 10.0); + textEffects->ShadowVal->Yoffset->showValue(y / 10.0); +} + +void PropertyWidget_Advanced::showStrikeThru(double p, double w) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + textEffects->StrikeVal->LPos->showValue(p / 10.0); + textEffects->StrikeVal->LWidth->showValue(w / 10.0); +} + +void PropertyWidget_Advanced::showTextEffects(int s) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + + textEffects->setStyle(s); + labelOutlineColor->setVisible( (s & 4) || (s & 256) ); +} + +void PropertyWidget_Advanced::showUnderline(double p, double w) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + textEffects->UnderlineVal->LPos->showValue(p / 10.0); + textEffects->UnderlineVal->LWidth->showValue(w / 10.0); +} + void PropertyWidget_Advanced::handleBaselineOffset() { if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) @@ -317,6 +391,109 @@ } } +void PropertyWidget_Advanced::handleUnderline() +{ + if ((m_doc) && (m_item)) + { + int x = qRound(textEffects->UnderlineVal->LPos->value() * 10.0); + int y = qRound(textEffects->UnderlineVal->LWidth->value() * 10.0); + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_doc->itemSelection_SetUnderline(x, y, &tempSelection); + } + } +} + +void PropertyWidget_Advanced::handleOutlineWidth() +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + int x = qRound(textEffects->OutlineVal->LWidth->value() * 10.0); + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_doc->itemSelection_SetOutlineWidth(x, &tempSelection); + } +} + +void PropertyWidget_Advanced::handleShadowOffs() +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + int x = qRound(textEffects->ShadowVal->Xoffset->value() * 10.0); + int y = qRound(textEffects->ShadowVal->Yoffset->value() * 10.0); + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_doc->itemSelection_SetShadowOffsets(x, y, &tempSelection); + } +} + +void PropertyWidget_Advanced::handleTypeStyle(int s) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_doc->itemSelection_SetEffects(s, &tempSelection); + m_ScMW->setStyleEffects(s); + } +} + +void PropertyWidget_Advanced::handleStrikeThru() +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + int x = qRound(textEffects->StrikeVal->LPos->value() * 10.0); + int y = qRound(textEffects->StrikeVal->LWidth->value() * 10.0); + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_doc->itemSelection_SetStrikethru(x, y, &tempSelection); + } +} + +void PropertyWidget_Advanced::handleTextOutline() +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_blockUpdate = true; + m_doc->itemSelection_SetStrokeColor(buttonOutlineColor->colorName(), &tempSelection); + m_doc->itemSelection_SetStrokeShade(buttonOutlineColor->colorData().Shade, &tempSelection); + m_blockUpdate = false; + } +} + void PropertyWidget_Advanced::updateCharStyle(const CharStyle& charStyle) { if (!m_ScMW || m_ScMW->scriptIsRunning()) @@ -326,6 +503,12 @@ showTextScaleV(charStyle.scaleV()); showTracking(charStyle.tracking()); showBaseLineOffset(charStyle.baselineOffset()); + showOutlineW(charStyle.outlineWidth()); + showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset()); + showTextColors(charStyle.strokeColor(), charStyle.strokeShade()); + showTextEffects(charStyle.effects()); + showStrikeThru(charStyle.strikethruOffset(), charStyle.strikethruWidth()); + showUnderline(charStyle.underlineOffset(), charStyle.underlineWidth()); normWordTrackingSpinBox->showValue(charStyle.wordTracking() * 100.0); } @@ -341,6 +524,12 @@ showTextScaleV(charStyle.scaleV()); showTracking(charStyle.tracking()); showBaseLineOffset(charStyle.baselineOffset()); + showOutlineW(charStyle.outlineWidth()); + showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset()); + showTextColors(charStyle.strokeColor(), charStyle.strokeShade()); + showTextEffects(charStyle.effects()); + showStrikeThru(charStyle.strikethruOffset(), charStyle.strikethruWidth()); + showUnderline(charStyle.underlineOffset(), charStyle.underlineWidth()); minWordTrackingSpinBox->showValue(newCurrent.minWordTracking() * 100.0); normWordTrackingSpinBox->showValue(newCurrent.charStyle().wordTracking() * 100.0); @@ -360,16 +549,31 @@ void PropertyWidget_Advanced::iconSetChange() { - textBaseLabel->setPixmap(IconManager::instance().loadPixmap("textbase.png")); - trackingLabel->setPixmap(IconManager::instance().loadPixmap("textkern.png")); + IconManager &im = IconManager::instance(); - scaleHLabel->setPixmap(IconManager::instance().loadPixmap("textscaleh.png")); - scaleVLabel->setPixmap(IconManager::instance().loadPixmap("textscalev.png")); + textBaseLabel->setPixmap(im.loadPixmap("character-offset-baseline")); + trackingLabel->setPixmap(im.loadPixmap("character-letter-tracking")); + + scaleHLabel->setPixmap(im.loadPixmap("character-scale-width")); + scaleVLabel->setPixmap(im.loadPixmap("character-scale-height")); + + minWordTrackingLabel->setPixmap(im.loadPixmap("character-space-width-min")); + normWordTrackingLabel->setPixmap(im.loadPixmap("character-space-width")); + + minGlyphExtensionLabel->setPixmap(im.loadPixmap("character-scale-width-min")); + maxGlyphExtensionLabel->setPixmap(im.loadPixmap("character-scale-width-max")); + + buttonOutlineColor->setIcon(im.loadIcon("text-outline-color", buttonOutlineColor->iconSize())); + } void PropertyWidget_Advanced::languageChange() { retranslateUi(this); + + textEffects->languageChange(); + buttonOutlineColor->setPersistentToolTip( tr("Color of text stroke and/or drop shadow, depending which is chosen. If both are chosen, then they share the same color.")); + } void PropertyWidget_Advanced::localeChange() @@ -383,4 +587,28 @@ normWordTrackingSpinBox->setLocale(l); minGlyphExtSpinBox->setLocale(l); maxGlyphExtSpinBox->setLocale(l); + + textEffects->ShadowVal->Xoffset->setLocale(l); + textEffects->ShadowVal->Yoffset->setLocale(l); + textEffects->OutlineVal->LWidth->setLocale(l); + textEffects->UnderlineVal->LPos->setLocale(l); + textEffects->UnderlineVal->LWidth->setLocale(l); + textEffects->StrikeVal->LPos->setLocale(l); + textEffects->StrikeVal->LWidth->setLocale(l); } + +void PropertyWidget_Advanced::toggleLabelVisibility(bool v) +{ + labelOutlineColor->setLabelVisibility(v); + labelTextEffects->setLabelVisibility(v); + + // textBaseLabel->setUseIcon(true); + // trackingLabel->setUseIcon(true); + // scaleHLabel->setUseIcon(true); + // scaleVLabel->setUseIcon(true); + // minWordTrackingLabel->setUseIcon(true); + // normWordTrackingLabel->setUseIcon(true); + // minGlyphExtensionLabel->setUseIcon(true); + // maxGlyphExtensionLabel->setUseIcon(true); + +} Index: scribus/ui/propertywidget_advanced.h =================================================================== --- scribus/ui/propertywidget_advanced.h (Revision 26312) +++ scribus/ui/propertywidget_advanced.h (Arbeitskopie) @@ -32,6 +32,7 @@ double m_unitRatio {1.0}; int m_unitIndex {SC_PT}; + bool m_blockUpdate {false}; PageItem *m_item {nullptr}; ScribusMainWindow* m_ScMW {nullptr}; @@ -50,6 +51,7 @@ void languageChange(); void unitChange() {}; void localeChange(); + void toggleLabelVisibility(bool v); void showBaseLineOffset(double e); void showTextScaleH(double e); @@ -56,6 +58,13 @@ void showTextScaleV(double e); void showTracking(double e); + void showTextColors(const QString& strokeCol, double strokeShd); + void showOutlineW(double x); + void showShadowOffset(double x, double y); + void showStrikeThru(double p, double w); + void showTextEffects(int s); + void showUnderline(double p, double w); + void updateCharStyle(const CharStyle& charStyle); void updateStyle(const ParagraphStyle& newCurrent); @@ -69,6 +78,13 @@ void handleTextScaleV(); void handleTracking(); + void handleOutlineWidth(); + void handleShadowOffs(); + void handleStrikeThru(); + void handleTypeStyle(int s); + void handleUnderline(); + void handleTextOutline(); + }; #endif Index: scribus/ui/propertywidget_advancedbase.ui =================================================================== --- scribus/ui/propertywidget_advancedbase.ui (Revision 26312) +++ scribus/ui/propertywidget_advancedbase.ui (Arbeitskopie) @@ -6,293 +6,528 @@ <rect> <x>0</x> <y>0</y> - <width>278</width> - <height>161</height> + <width>244</width> + <height>192</height> </rect> </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QGridLayout" name="gridLayout"> + <layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0"> <property name="leftMargin"> - <number>3</number> + <number>8</number> </property> <property name="topMargin"> - <number>3</number> + <number>8</number> </property> <property name="rightMargin"> - <number>3</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>3</number> + <number>8</number> </property> - <property name="spacing"> - <number>3</number> + <property name="horizontalSpacing"> + <number>16</number> </property> - <item row="0" column="0"> - <widget class="QLabel" name="textBaseLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> + <property name="verticalSpacing"> + <number>4</number> + </property> + <item row="3" column="0"> + <widget class="FormWidget" name="minWordTrackingLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>22</height> - </size> - </property> - <property name="text"> + <property name="label" stdset="0"> <string/> </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> </property> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="minWordTrackingSpinBox"> + <property name="toolTip"> + <string>Minimal width of spaces between words</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + <property name="minimum"> + <double>1.000000000000000</double> + </property> + <property name="maximum"> + <double>200.000000000000000</double> + </property> + <property name="value"> + <double>100.000000000000000</double> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="0" column="1"> - <widget class="ScrSpinBox" name="textBase"> - <property name="toolTip"> - <string>Offset to baseline of characters</string> + <item row="1" column="0"> + <widget class="FormWidget" name="textBaseLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="suffix"> - <string> %</string> + <property name="label" stdset="0"> + <string/> </property> - <property name="minimum"> - <double>-100.000000000000000</double> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> </property> - <property name="maximum"> - <double>100.000000000000000</double> - </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="textBase"> + <property name="toolTip"> + <string>Offset to baseline of characters</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + <property name="minimum"> + <double>-100.000000000000000</double> + </property> + <property name="maximum"> + <double>100.000000000000000</double> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="0" column="2"> - <widget class="QLabel" name="trackingLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> + <item row="4" column="1"> + <widget class="FormWidget" name="maxGlyphExtensionLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>22</height> - </size> - </property> - <property name="text"> + <property name="label" stdset="0"> <string/> </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> </property> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="maxGlyphExtSpinBox"> + <property name="toolTip"> + <string>Maximal extension of glyphs for justification</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + <property name="minimum"> + <double>90.000000000000000</double> + </property> + <property name="maximum"> + <double>110.000000000000000</double> + </property> + <property name="value"> + <double>100.000000000000000</double> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="0" column="3"> - <widget class="ScrSpinBox" name="tracking"> - <property name="toolTip"> - <string>Manual Tracking</string> + <item row="4" column="0"> + <widget class="FormWidget" name="minGlyphExtensionLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="suffix"> - <string> %</string> + <property name="label" stdset="0"> + <string/> </property> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="minGlyphExtSpinBox"> + <property name="toolTip"> + <string>Minimal shrinkage of glyphs for justification</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + <property name="minimum"> + <double>90.000000000000000</double> + </property> + <property name="maximum"> + <double>110.000000000000000</double> + </property> + <property name="value"> + <double>100.000000000000000</double> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="scaleHLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> + <item row="3" column="1"> + <widget class="FormWidget" name="normWordTrackingLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>22</height> - </size> - </property> - <property name="text"> + <property name="label" stdset="0"> <string/> </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> </property> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="normWordTrackingSpinBox"> + <property name="toolTip"> + <string>Normal width of spaces between words</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + <property name="minimum"> + <double>1.000000000000000</double> + </property> + <property name="maximum"> + <double>2000.000000000000000</double> + </property> + <property name="value"> + <double>100.000000000000000</double> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="1" column="1"> - <widget class="ScrSpinBox" name="scaleH"> - <property name="toolTip"> - <string>Scaling width of characters</string> + <item row="1" column="2"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="suffix"> - <string> %</string> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QLabel" name="scaleVLabel"> - <property name="minimumSize"> + <property name="sizeHint" stdset="0"> <size> - <width>20</width> + <width>0</width> <height>0</height> </size> </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>22</height> - </size> + </spacer> + </item> + <item row="2" column="0"> + <widget class="FormWidget" name="scaleHLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="text"> + <property name="label" stdset="0"> <string/> </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="scaleH"> + <property name="toolTip"> + <string>Scaling width of characters</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="1" column="3"> - <widget class="ScrSpinBox" name="scaleV"> - <property name="toolTip"> - <string>Scaling height of characters</string> + <item row="1" column="1"> + <widget class="FormWidget" name="trackingLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="suffix"> - <string> %</string> + <property name="label" stdset="0"> + <string/> </property> - </widget> - </item> - <item row="2" column="0" colspan="2"> - <widget class="QLabel" name="wordTrackingLabel"> - <property name="text"> - <string>Word Tracking</string> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="tracking"> + <property name="toolTip"> + <string>Manual Tracking</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="3" column="0"> - <widget class="QLabel" name="minWordTrackingLabel"> - <property name="text"> - <string>Min:</string> + <item row="2" column="1"> + <widget class="FormWidget" name="scaleVLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="ScrSpinBox" name="minWordTrackingSpinBox"> - <property name="toolTip"> - <string>Minimal width of spaces between words</string> + <property name="label" stdset="0"> + <string/> </property> - <property name="suffix"> - <string> %</string> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> </property> - <property name="minimum"> - <double>1.000000000000000</double> - </property> - <property name="maximum"> - <double>200.000000000000000</double> - </property> - <property name="value"> - <double>100.000000000000000</double> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="scaleV"> + <property name="toolTip"> + <string>Scaling height of characters</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="3" column="3"> - <widget class="ScrSpinBox" name="normWordTrackingSpinBox"> - <property name="toolTip"> - <string>Normal width of spaces between words</string> - </property> - <property name="suffix"> - <string> %</string> - </property> - <property name="minimum"> - <double>1.000000000000000</double> - </property> - <property name="maximum"> - <double>2000.000000000000000</double> - </property> - <property name="value"> - <double>100.000000000000000</double> - </property> - </widget> + <item row="0" column="0" colspan="3"> + <layout class="QHBoxLayout" name="horizontalLayout_10"> + <item> + <widget class="FormWidget" name="labelTextEffects"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <property name="preserveLabelSpace"> + <bool>true</bool> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="StyleSelect" name="textEffects" native="true"/> + </item> + </layout> + </widget> + </item> + <item> + <widget class="FormWidget" name="labelOutlineColor"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Stroke</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ColorButton" name="buttonOutlineColor"> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> </item> - <item row="3" column="2"> - <widget class="QLabel" name="normWordTrackingLabel"> - <property name="text"> - <string>Norm:</string> - </property> - </widget> - </item> - <item row="4" column="0" colspan="2"> - <widget class="QLabel" name="glyphExtensionLabel"> - <property name="text"> - <string>Glyph Extension</string> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="minGlyphExtensionLabel"> - <property name="text"> - <string>Min:</string> - </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="ScrSpinBox" name="minGlyphExtSpinBox"> - <property name="toolTip"> - <string>Minimal shrinkage of glyphs for justification</string> - </property> - <property name="suffix"> - <string> %</string> - </property> - <property name="minimum"> - <double>90.000000000000000</double> - </property> - <property name="maximum"> - <double>110.000000000000000</double> - </property> - <property name="value"> - <double>100.000000000000000</double> - </property> - </widget> - </item> - <item row="5" column="3"> - <widget class="ScrSpinBox" name="maxGlyphExtSpinBox"> - <property name="toolTip"> - <string>Maximal extension of glyphs for justification</string> - </property> - <property name="suffix"> - <string> %</string> - </property> - <property name="minimum"> - <double>90.000000000000000</double> - </property> - <property name="maximum"> - <double>110.000000000000000</double> - </property> - <property name="value"> - <double>100.000000000000000</double> - </property> - </widget> - </item> - <item row="5" column="2"> - <widget class="QLabel" name="maxGlyphExtensionLabel"> - <property name="text"> - <string>Max:</string> - </property> - </widget> - </item> </layout> </widget> <customwidgets> <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>ColorButton</class> + <extends>QToolButton</extends> + <header>ui/widgets/color_button.h</header> + </customwidget> + <customwidget> <class>ScrSpinBox</class> <extends>QDoubleSpinBox</extends> - <header>ui/scrspinbox.h</header> + <header location="global">ui/scrspinbox.h</header> </customwidget> + <customwidget> + <class>StyleSelect</class> + <extends>QWidget</extends> + <header>ui/styleselect.h</header> + <container>1</container> + </customwidget> </customwidgets> + <tabstops> + <tabstop>buttonOutlineColor</tabstop> + <tabstop>textBase</tabstop> + <tabstop>tracking</tabstop> + <tabstop>scaleH</tabstop> + <tabstop>scaleV</tabstop> + <tabstop>minWordTrackingSpinBox</tabstop> + <tabstop>normWordTrackingSpinBox</tabstop> + <tabstop>minGlyphExtSpinBox</tabstop> + <tabstop>maxGlyphExtSpinBox</tabstop> + </tabstops> <resources/> <connections/> </ui> Index: scribus/ui/propertywidget_alignment.ui =================================================================== --- scribus/ui/propertywidget_alignment.ui (nicht existent) +++ scribus/ui/propertywidget_alignment.ui (Arbeitskopie) @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>PropertyWidget_Alignment</class> + <widget class="QWidget" name="PropertyWidget_Alignment"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>239</width> + <height>106</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>8</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="spacing"> + <number>16</number> + </property> + <item> + <widget class="AlignSelect" name="textAlignment" native="true"/> + </item> + <item> + <widget class="AlignVerticalSelect" name="textVerticalAlignment" native="true"/> + </item> + <item> + <widget class="DirectionSelect" name="textDirection" native="true"/> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0,0,1"> + <property name="spacing"> + <number>16</number> + </property> + <item> + <widget class="FlopWidget" name="flopWidget" native="true"/> + </item> + <item> + <widget class="OpticalMarginsWidget" name="opticalMarginsWidget" native="true"/> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_9" stretch="0,1"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="tabsButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Edit tab settings of text frame...</string> + </property> + <property name="text"> + <string>T&abulators...</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>FlopWidget</class> + <extends>QWidget</extends> + <header>ui/flopwidget.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>OpticalMarginsWidget</class> + <extends>QWidget</extends> + <header>ui/opticalmarginswidget.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>AlignSelect</class> + <extends>QWidget</extends> + <header>ui/alignselect.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>DirectionSelect</class> + <extends>QWidget</extends> + <header>ui/directionselect.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>AlignVerticalSelect</class> + <extends>QWidget</extends> + <header>ui/alignverticalselect.h</header> + <container>1</container> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> Index: scribus/ui/propertywidget_distance.cpp =================================================================== --- scribus/ui/propertywidget_distance.cpp (Revision 26312) +++ scribus/ui/propertywidget_distance.cpp (Arbeitskopie) @@ -11,6 +11,7 @@ #include "appmodehelper.h" #include "appmodes.h" +#include "iconmanager.h" #include "localemgr.h" #include "pageitem_table.h" #include "pageitem_textframe.h" @@ -26,29 +27,24 @@ layout()->setAlignment(Qt::AlignTop); - columnsLabel->setBuddy(columns); columnGap->setValues(0, 300, 2, 0); + columns->setDecimals(0); + columns->setSuffix(""); - topDistance->setValues(0, 300, 2, 0); - topLabel->setBuddy(topDistance); + MarginStruct distances; + distances.resetToZero(); - bottomDistance->setValues(0, 300, 2, 0); - bottomLabel->setBuddy(bottomDistance); + distanceWidget->setup(distances, 0, m_unitIndex, NewMarginWidget::DistanceWidgetFlags); + distanceWidget->toggleLabelVisibility(false); - leftDistance->setValues(0, 300, 2, 0); - leftLabel->setBuddy(leftDistance); - - rightDistance->setValues(0, 300, 2, 0); - rightLabel->setBuddy(rightDistance); - - columns->setDecimals(0); - columns->setSuffix(""); - + iconSetChange(); languageChange(); - columnGapLabel->setCurrentIndex(0); + columnGapCombo->setCurrentIndex(0); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void PropertyWidget_Distance::setMainWindow(ScribusMainWindow* mw) @@ -84,10 +80,6 @@ columns->setDecimals(0); columnGap->setDecimals(2); - topDistance->setDecimals(2); - leftDistance->setDecimals(2); - bottomDistance->setDecimals(2); - rightDistance->setDecimals(2); connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); connect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); @@ -119,11 +111,15 @@ textItem = m_item->asTable()->activeCell().textFrame(); if (!textItem) return; + ParagraphStyle parStyle = m_item->itemText.defaultStyle(); + if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable) + m_item->currentTextProps(parStyle); + //#14427: columns->setMaximum(qMax(qRound(textItem->width() / qMax(textItem->ColGap, 10.0)), 1)); columns->setMinimum(1); columns->setValue(textItem->m_columns); columnGap->setMinimum(0); - if (columnGapLabel->currentIndex() == 0) + if (columnGapCombo->currentIndex() == 0) { columnGap->setMaximum(qMax((textItem->width() / textItem->m_columns - textItem->textToFrameDistLeft() - textItem->textToFrameDistRight()) * m_unitRatio, 0.0)); columnGap->setValue(textItem->m_columnGap * m_unitRatio); @@ -133,23 +129,21 @@ columnGap->setMaximum(qMax((textItem->width() / textItem->m_columns) * m_unitRatio, 0.0)); columnGap->setValue(textItem->columnWidth() * m_unitRatio); } - leftDistance->setValue(textItem->textToFrameDistLeft()*m_unitRatio); - topDistance->setValue(textItem->textToFrameDistTop()*m_unitRatio); - bottomDistance->setValue(textItem->textToFrameDistBottom()*m_unitRatio); - rightDistance->setValue(textItem->textToFrameDistRight()*m_unitRatio); - if (columns->value() == 1) - { - columnGap->setEnabled(false); - columnGapLabel->setEnabled(false); - } - else - { - columnGap->setEnabled(true); - columnGapLabel->setEnabled(true); - } - showTextDistances(textItem->textToFrameDistLeft(), textItem->textToFrameDistTop(), textItem->textToFrameDistBottom(), textItem->textToFrameDistRight()); - verticalAlign->setCurrentIndex(textItem->verticalAlignment()); + MarginStruct distances; + distances.set( + textItem->textToFrameDistTop(), + textItem->textToFrameDistLeft(), + textItem->textToFrameDistBottom(), + textItem->textToFrameDistRight() + ); + distanceWidget->setPageHeight(m_item->height()); + distanceWidget->setPageWidth(m_item->width()); + distanceWidget->setNewValues(distances); + + columnGapLabel->setVisible(columns->value() != 1); + columnGapSizeLabel->setVisible(columns->value() != 1); + connectSignals(); } @@ -157,13 +151,8 @@ { connect(columns , SIGNAL(valueChanged(double)) , this, SLOT(handleColumns()), Qt::UniqueConnection); connect(columnGap , SIGNAL(valueChanged(double)), this, SLOT(handleColumnGap()), Qt::UniqueConnection); - connect(columnGapLabel, SIGNAL(activated(int)) , this, SLOT(handleGapSwitch()), Qt::UniqueConnection); - connect(topDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); - connect(leftDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); - connect(rightDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); - connect(bottomDistance, SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); - connect(tabsButton , SIGNAL(clicked()) , this, SLOT(handleTabs()), Qt::UniqueConnection); - connect(verticalAlign , SIGNAL(activated(int)) , this, SLOT(handleVAlign()), Qt::UniqueConnection); + connect(columnGapCombo, SIGNAL(activated(int)) , this, SLOT(handleGapSwitch()), Qt::UniqueConnection); + connect(distanceWidget, SIGNAL(valuesChanged(MarginStruct)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); } void PropertyWidget_Distance::disconnectSignals() @@ -170,13 +159,8 @@ { disconnect(columns , SIGNAL(valueChanged(double)) , this, SLOT(handleColumns())); disconnect(columnGap , SIGNAL(valueChanged(double)), this, SLOT(handleColumnGap())); - disconnect(columnGapLabel, SIGNAL(activated(int)) , this, SLOT(handleGapSwitch())); - disconnect(topDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances())); - disconnect(leftDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances())); - disconnect(rightDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances())); - disconnect(bottomDistance, SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances())); - disconnect(tabsButton , SIGNAL(clicked()) , this, SLOT(handleTabs())); - disconnect(verticalAlign , SIGNAL(activated(int)) , this, SLOT(handleVAlign())); + disconnect(columnGapCombo, SIGNAL(activated(int)) , this, SLOT(handleGapSwitch())); + disconnect(distanceWidget, SIGNAL(valuesChanged(MarginStruct)), this, SLOT(handleTextDistances())); } void PropertyWidget_Distance::configureWidgets() @@ -195,8 +179,8 @@ { int numCols = textItem->m_columns; - columnGap->setEnabled(numCols != 1); - columnGapLabel->setEnabled(numCols != 1); + columnGapLabel->setVisible(numCols != 1); + columnGapSizeLabel->setVisible(numCols != 1); } } setEnabled(enabled); @@ -225,6 +209,13 @@ // Nothing to do in this widget } +void PropertyWidget_Distance::iconSetChange() +{ + IconManager &im = IconManager::instance(); + + columnsLabel->setPixmap(im.loadPixmap("paragraph-columns")); +} + void PropertyWidget_Distance::showColumns(int r, double g) { if (!m_ScMW || m_ScMW->scriptIsRunning()) @@ -244,7 +235,7 @@ if (textItem != nullptr) { //#14427: columns->setMaximum(qMax(qRound(textItem->width() / qMax(textItem->ColGap, 10.0)), 1)); - if (columnGapLabel->currentIndex() == 0) + if (columnGapCombo->currentIndex() == 0) { columnGap->setMaximum(qMax((textItem->width() / textItem->m_columns - textItem->textToFrameDistLeft() - textItem->textToFrameDistRight()) * m_unitRatio, 0.0)); columnGap->setValue(textItem->m_columnGap * m_unitRatio); @@ -258,21 +249,13 @@ } columns->setMinimum(1); columnGap->setMinimum(0); - columnGap->setEnabled(columns->value() != 1); - columnGapLabel->setEnabled(columns->value() != 1); + columnGapLabel->setVisible(columns->value() != 1); + columnGapSizeLabel->setVisible(columns->value() != 1); columns->blockSignals(cSigWasBlocked); columnGap->blockSignals(cGapSigWasBlocked); } -void PropertyWidget_Distance::showTextDistances(double left, double top, double bottom, double right) -{ - leftDistance->showValue(left * m_unitRatio); - topDistance->showValue(top * m_unitRatio); - bottomDistance->showValue(bottom * m_unitRatio); - rightDistance->showValue(right * m_unitRatio); -} - void PropertyWidget_Distance::handleColumns() { if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) @@ -304,7 +287,7 @@ if (!textItem) return; - if (columnGapLabel->currentIndex() == 0) + if (columnGapCombo->currentIndex() == 0) textItem->setColumnGap(columnGap->value() / m_unitRatio); else { @@ -331,27 +314,10 @@ if (textItem != nullptr) showColumns(textItem->m_columns, textItem->m_columnGap); - int index = columnGapLabel->currentIndex(); + int index = columnGapCombo->currentIndex(); columnGap->setToolTip((index == 0) ? tr( "Distance between columns" ) : tr( "Column width" )); } -void PropertyWidget_Distance::handleVAlign() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *textItem = m_item; - if (m_doc->appMode == modeEditTable) - textItem = m_item->asTable()->activeCell().textFrame(); - if (textItem != nullptr) - { - textItem->setVerticalAlignment(verticalAlign->currentIndex()); - textItem->update(); - if (m_doc->appMode == modeEditTable) - m_item->asTable()->update(); - m_doc->regionsChanged()->update(QRect()); - } -} - void PropertyWidget_Distance::handleTabs() { if (!m_doc || !m_item) @@ -393,10 +359,10 @@ textItem = m_item->asTable()->activeCell().textFrame(); if (!textItem) return; - double left = leftDistance->value() / m_unitRatio; - double right = rightDistance->value() / m_unitRatio; - double top = topDistance->value() / m_unitRatio; - double bottom = bottomDistance->value() / m_unitRatio; + double left = distanceWidget->margins().left(); + double right = distanceWidget->margins().right(); + double top = distanceWidget->margins().top(); + double bottom = distanceWidget->margins().bottom(); textItem->setTextToFrameDist(left, right, top, bottom); showColumns(textItem->m_columns, textItem->m_columnGap); @@ -420,30 +386,18 @@ { retranslateUi(this); - QSignalBlocker verticalAlignBlocker(verticalAlign); - int oldAlignIndex = verticalAlign->currentIndex(); - verticalAlign->clear(); - verticalAlign->addItem( tr("Top")); - verticalAlign->addItem( tr("Middle")); - verticalAlign->addItem( tr("Bottom")); - verticalAlign->setCurrentIndex(oldAlignIndex); + QSignalBlocker columnGapLabelBlocker(columnGapCombo); + int oldColGapLabel = columnGapCombo->currentIndex(); + columnGapCombo->clear(); + columnGapCombo->addItem( tr("Gap:")); + columnGapCombo->addItem( tr("Width:")); + columnGapCombo->setCurrentIndex(oldColGapLabel); - QSignalBlocker columnGapLabelBlocker(columnGapLabel); - int oldColGapLabel = columnGapLabel->currentIndex(); - columnGapLabel->clear(); - columnGapLabel->addItem( tr("Gap:")); - columnGapLabel->addItem( tr("Width:")); - columnGapLabel->setCurrentIndex(oldColGapLabel); - QString ptSuffix = tr(" pt"); - QString suffix = (m_doc) ? unitGetSuffixFromIndex(m_doc->unitIndex()) : ptSuffix; columnGap->setSuffix(suffix); - leftDistance->setSuffix(suffix); - topDistance->setSuffix(suffix); - bottomDistance->setSuffix(suffix); - rightDistance->setSuffix(suffix); + } void PropertyWidget_Distance::unitChange() @@ -452,19 +406,13 @@ return; QSignalBlocker columnGapBlocker(columnGap); - QSignalBlocker leftDistanceBlocker(leftDistance); - QSignalBlocker topDistanceBlocker(topDistance); - QSignalBlocker bottomDistanceBlocker(bottomDistance); - QSignalBlocker rightDistanceBlocker(rightDistance); + QSignalBlocker distancesBlocker(distanceWidget); m_unitRatio = m_doc->unitRatio(); m_unitIndex = m_doc->unitIndex(); columnGap->setNewUnit(m_unitIndex); - leftDistance->setNewUnit(m_unitIndex); - topDistance->setNewUnit(m_unitIndex); - bottomDistance->setNewUnit(m_unitIndex); - rightDistance->setNewUnit(m_unitIndex); + distanceWidget->setNewUnit(m_unitIndex); } void PropertyWidget_Distance::localeChange() @@ -471,8 +419,12 @@ { const QLocale& l(LocaleManager::instance().userPreferredLocale()); columnGap->setLocale(l); - topDistance->setLocale(l); - bottomDistance->setLocale(l); - leftDistance->setLocale(l); - rightDistance->setLocale(l); + distanceWidget->setLocale(l); } + +void PropertyWidget_Distance::toggleLabelVisibility(bool v) +{ + columnGapSizeLabel->setLabelVisibility(v); + columnGapLabel->setLabelVisibility(v); + columnsLabel->setLabelVisibility(v); +} Index: scribus/ui/propertywidget_distance.h =================================================================== --- scribus/ui/propertywidget_distance.h (Revision 26312) +++ scribus/ui/propertywidget_distance.h (Arbeitskopie) @@ -46,12 +46,13 @@ void handleSelectionChanged(); void handleUpdateRequest(int); + void iconSetChange(); void languageChange(); void unitChange(); void localeChange(); + void toggleLabelVisibility(bool v); void showColumns(int r, double g); - void showTextDistances(double left, double top, double bottom, double right); private slots: void handleColumns(); @@ -58,7 +59,6 @@ void handleColumnGap(); void handleGapSwitch(); void handleTabs(); - void handleVAlign(); void handleTextDistances(); }; Index: scribus/ui/propertywidget_distancebase.ui =================================================================== --- scribus/ui/propertywidget_distancebase.ui (Revision 26312) +++ scribus/ui/propertywidget_distancebase.ui (Arbeitskopie) @@ -6,176 +6,229 @@ <rect> <x>0</x> <y>0</y> - <width>223</width> - <height>232</height> + <width>266</width> + <height>98</height> </rect> </property> - <layout class="QGridLayout" name="gridLayout"> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>8</number> + </property> <property name="leftMargin"> - <number>3</number> + <number>8</number> </property> <property name="topMargin"> - <number>3</number> + <number>8</number> </property> <property name="rightMargin"> - <number>3</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>3</number> + <number>8</number> </property> - <property name="spacing"> - <number>3</number> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="verticalAlignLabel"> - <property name="text"> - <string>Vertical Alignment:</string> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,1"> + <property name="spacing"> + <number>4</number> </property> - </widget> + <item> + <widget class="NewMarginWidget" name="distanceWidget" native="true"/> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> </item> - <item row="0" column="1"> - <widget class="QComboBox" name="verticalAlign"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>4</number> + </property> <item> - <property name="text"> - <string>Top</string> - </property> + <widget class="FormWidget" name="columnsLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Col&umns</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="columns"> + <property name="toolTip"> + <string>Number of columns in text frame</string> + </property> + <property name="minimum"> + <double>1.000000000000000</double> + </property> + <property name="maximum"> + <double>3000.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> </item> <item> - <property name="text"> - <string>Middle</string> - </property> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Policy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>8</width> + <height>0</height> + </size> + </property> + </spacer> </item> <item> - <property name="text"> - <string>Bottom</string> - </property> + <widget class="FormWidget" name="columnGapLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <property name="preserveLabelSpace"> + <bool>true</bool> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QComboBox" name="columnGapCombo"> + <property name="toolTip"> + <string>Switches between Gap or Column width</string> + </property> + <property name="sizeAdjustPolicy"> + <enum>QComboBox::SizeAdjustPolicy::AdjustToContents</enum> + </property> + <item> + <property name="text"> + <string>Gap:</string> + </property> + </item> + <item> + <property name="text"> + <string>Width:</string> + </property> + </item> + </widget> + </item> + </layout> + </widget> </item> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="columnsLabel"> - <property name="text"> - <string>Colu&mns:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="ScrSpinBox" name="columns"> - <property name="toolTip"> - <string>Number of columns in text frame</string> - </property> - <property name="minimum"> - <double>1.000000000000000</double> - </property> - <property name="maximum"> - <double>3000.000000000000000</double> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QComboBox" name="columnGapLabel"> - <property name="toolTip"> - <string>Switches between Gap or Column width</string> - </property> <item> - <property name="text"> - <string>Gap:</string> - </property> + <widget class="FormWidget" name="columnGapSizeLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Size</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="columnGap"> + <property name="toolTip"> + <string>Distance between columns</string> + </property> + </widget> + </item> + </layout> + </widget> </item> <item> - <property name="text"> - <string>Width:</string> - </property> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> </item> - </widget> + </layout> </item> - <item row="2" column="1"> - <widget class="ScrSpinBox" name="columnGap"> - <property name="toolTip"> - <string>Distance between columns</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="topLabel"> - <property name="text"> - <string>To&p:</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="ScrSpinBox" name="topDistance"> - <property name="toolTip"> - <string>Distance of text from top of frame</string> - </property> - </widget> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="bottomLabel"> - <property name="text"> - <string>&Bottom:</string> - </property> - </widget> - </item> - <item row="4" column="1"> - <widget class="ScrSpinBox" name="bottomDistance"> - <property name="toolTip"> - <string>Distance of text from bottom of frame</string> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="leftLabel"> - <property name="text"> - <string>&Left:</string> - </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="ScrSpinBox" name="leftDistance"> - <property name="toolTip"> - <string>Distance of text from left of frame</string> - </property> - </widget> - </item> - <item row="6" column="0"> - <widget class="QLabel" name="rightLabel"> - <property name="text"> - <string>&Right:</string> - </property> - </widget> - </item> - <item row="6" column="1"> - <widget class="ScrSpinBox" name="rightDistance"> - <property name="toolTip"> - <string>Distance of text from right of frame</string> - </property> - </widget> - </item> - <item row="7" column="0" colspan="2"> - <widget class="QToolButton" name="tabsButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Edit tab settings of text frame...</string> - </property> - <property name="text"> - <string>T&abulators...</string> - </property> - </widget> - </item> </layout> </widget> <customwidgets> <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + <customwidget> <class>ScrSpinBox</class> <extends>QDoubleSpinBox</extends> - <header>ui/scrspinbox.h</header> + <header location="global">ui/scrspinbox.h</header> </customwidget> + <customwidget> + <class>NewMarginWidget</class> + <extends>QWidget</extends> + <header>ui/newmarginwidget.h</header> + <container>1</container> + </customwidget> </customwidgets> <resources/> <connections/> Index: scribus/ui/propertywidget_flop.cpp =================================================================== --- scribus/ui/propertywidget_flop.cpp (Revision 26312) +++ scribus/ui/propertywidget_flop.cpp (nicht existent) @@ -1,52 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ - -#include "propertywidget_flop.h" - -#include "scribusdoc.h" - -PropertyWidget_Flop::PropertyWidget_Flop(QWidget* parent) : QFrame(parent) -{ - setupUi(this); - - layout()->setAlignment(Qt::AlignTop); - - flopRealHeight->setChecked(true); - - flopGroup->setId(flopRealHeight, RealHeightID); - flopGroup->setId(flopFontAscent, FontAscentID); - flopGroup->setId(flopLineSpacing, LineSpacingID); - flopGroup->setId(flopBaselineGrid, BaselineGridID); - - languageChange(); -} - -void PropertyWidget_Flop::setDoc(ScribusDoc *d) -{ - if (d == (ScribusDoc*) m_doc) - return; - - m_doc = d; - - if (m_doc.isNull()) - return; -} - -void PropertyWidget_Flop::changeEvent(QEvent *e) -{ - if (e->type() == QEvent::LanguageChange) - { - languageChange(); - return; - } - QWidget::changeEvent(e); -} - -void PropertyWidget_Flop::languageChange() -{ - retranslateUi(this); -} Index: scribus/ui/propertywidget_flop.h =================================================================== --- scribus/ui/propertywidget_flop.h (Revision 26312) +++ scribus/ui/propertywidget_flop.h (nicht existent) @@ -1,46 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ -#ifndef PROPERTYWIDGET_FLOP_H -#define PROPERTYWIDGET_FLOP_H - -#include "ui_propertywidget_flopbase.h" - -#include "scguardedptr.h" - -class ScribusDoc; - -class PropertyWidget_Flop : public QFrame, public Ui::PropertyWidget_FlopBase -{ - Q_OBJECT - -public: - - enum FlopButtonID - { - RealHeightID = 0, - FontAscentID = 1, - LineSpacingID = 2, - BaselineGridID = 3 - }; - - PropertyWidget_Flop(QWidget* parent); - ~PropertyWidget_Flop() {}; - -protected: - ScGuardedPtr<ScribusDoc> m_doc; - - void changeEvent(QEvent *e) override; - -public slots: - - void setDoc(ScribusDoc *d); - - void languageChange(); - void unitChange() {}; -}; - -#endif Index: scribus/ui/propertywidget_flopbase.ui =================================================================== --- scribus/ui/propertywidget_flopbase.ui (Revision 26312) +++ scribus/ui/propertywidget_flopbase.ui (nicht existent) @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>PropertyWidget_FlopBase</class> - <widget class="QFrame" name="PropertyWidget_FlopBase"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>218</width> - <height>107</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>3</number> - </property> - <property name="topMargin"> - <number>3</number> - </property> - <property name="rightMargin"> - <number>3</number> - </property> - <property name="bottomMargin"> - <number>3</number> - </property> - <item> - <widget class="QRadioButton" name="flopRealHeight"> - <property name="toolTip"> - <string>Set the height of the first line of the text frame to use the tallest height of the included characters</string> - </property> - <property name="text"> - <string>Maximum Ascent</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">flopGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="flopFontAscent"> - <property name="toolTip"> - <string>Set the height of the first line of text frame to use the full ascent of the font(s) in use</string> - </property> - <property name="text"> - <string>Font Ascent</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">flopGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="flopLineSpacing"> - <property name="toolTip"> - <string>Set the height of the first line of the text frame to the specified line height</string> - </property> - <property name="text"> - <string>Line Spacing</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">flopGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="flopBaselineGrid"> - <property name="toolTip"> - <string>Set the base line of the first line of the text frame to the base line grid</string> - </property> - <property name="text"> - <string>Baseline Grid</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">flopGroup</string> - </attribute> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> - <buttongroups> - <buttongroup name="flopGroup"/> - </buttongroups> -</ui> Index: scribus/ui/propertywidget_fontfeatures.cpp =================================================================== --- scribus/ui/propertywidget_fontfeatures.cpp (Revision 26312) +++ scribus/ui/propertywidget_fontfeatures.cpp (Arbeitskopie) @@ -4,15 +4,22 @@ a copyright and/or license notice that predates the release of Scribus 1.3.2 for which a new license (GPL+exception) is in place. */ + +#include <QButtonGroup> + #include "propertywidget_fontfeatures.h" +#include "iconmanager.h" +#include "localemgr.h" #include "appmodes.h" #include "pageitem_table.h" #include "scribus.h" +#include "scribusapp.h" #include "scribusdoc.h" #include "selection.h" #include "fonts/fontfeatures.h" + PropertyWidget_FontFeatures::PropertyWidget_FontFeatures(QWidget* parent) : QFrame(parent) { setupUi(this); @@ -20,7 +27,13 @@ layout()->setAlignment(Qt::AlignTop); initWidgets(); + iconSetChange(); languageChange(); + localeChange(); + + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void PropertyWidget_FontFeatures::setMainWindow(ScribusMainWindow *mw) @@ -38,11 +51,67 @@ QWidget::changeEvent(e); } +bool PropertyWidget_FontFeatures::eventFilter(QObject *obj, QEvent *e) +{ + if (e->type() == QEvent::Enter) + { + handleFontPreview(obj); + return true; + } + if (e->type() == QEvent::Leave) + { + fontPreview->setPixmap(QPixmap()); + return true; + } + + return QWidget::eventFilter(obj, e); +} + + +void PropertyWidget_FontFeatures::iconSetChange() +{ + IconManager& im = IconManager::instance(); + + // Literal Cases + SmallRadio->setIcon(im.loadIcon("ff-smcp")); + SmallFromCRadio->setIcon(im.loadIcon("ff-c2sc")); + AllSmallCapsRadio->setIcon(im.loadIcon("ff-c2sc-smcp")); + PetiteRadio->setIcon(im.loadIcon("ff-pcap")); + PetiteCapRadio->setIcon(im.loadIcon("ff-p2pc")); + AllPetiteCapsRadio->setIcon(im.loadIcon("ff-p2pc-pcap")); + UnicaseRadio->setIcon(im.loadIcon("ff-unic")); + TitlingRadio->setIcon(im.loadIcon("ff-titl")); + // Number Style + LiningRadio->setIcon(im.loadIcon("ff-lnum")); + OldStyleRadio->setIcon(im.loadIcon("ff-onum")); + // Number Width + ProportionalRadio->setIcon(im.loadIcon("ff-pnum")); + TabularRadio->setIcon(im.loadIcon("ff-tnum")); + // Number Fractions + DiagonalRadio->setIcon(im.loadIcon("ff-frac")); + StackedRadio->setIcon(im.loadIcon("ff-afrc")); + // Number Position + SubscriptRadio->setIcon(im.loadIcon("ff-subs")); + SuperscriptRadio->setIcon(im.loadIcon("ff-sups")); + OrdinalCheck->setIcon(im.loadIcon("ff-ordn")); + +} + void PropertyWidget_FontFeatures::languageChange() { retranslateUi(this); } +void PropertyWidget_FontFeatures::localeChange() +{ + //const QLocale& l(LocaleManager::instance().userPreferredLocale()); +} + +void PropertyWidget_FontFeatures::toggleLabelVisibility(bool v) +{ + // Nothing to do! +} + void PropertyWidget_FontFeatures::showFontFeatures(const QString& s, const QStringList& availableFeatures) { if (!m_ScMW || m_ScMW->scriptIsRunning()) @@ -81,7 +150,7 @@ if (featureFlags & FontFeatures::UnicaseCaps) UnicaseRadio->setChecked(true); if (featureFlags & FontFeatures::TiltingCaps) - TiltingRadio->setChecked(true); + TitlingRadio->setChecked(true); if (featureFlags & FontFeatures::LiningNumerals) LiningRadio->setChecked(true); @@ -183,7 +252,7 @@ font_feature << "+c2pc"; if (UnicaseRadio->isChecked()) font_feature << "+unic"; - if (TiltingRadio->isChecked()) + if (TitlingRadio->isChecked()) font_feature << "+titl"; //Numeric @@ -199,6 +268,8 @@ font_feature << "+frac"; if (StackedRadio->isChecked()) font_feature <<"+afrc"; + if (SlashedZeroCheck->isChecked()) + font_feature << "+zero"; //Position if (SubscriptRadio->isChecked()) @@ -208,9 +279,6 @@ if (OrdinalCheck->isChecked()) font_feature << "+ordn"; - if (SlashedZeroCheck->isChecked()) - font_feature << "+zero"; - // Stylistic sets if (StyleSet01->isChecked()) font_feature << "+ss01"; @@ -258,6 +326,59 @@ m_doc->itemSelection_SetFontFeatures(font_feature.join(","), &tempSelection); } +void PropertyWidget_FontFeatures::handleFontPreview(QObject *obj) +{ + IconManager& im = IconManager::instance(); + int h = 48; + + if (obj == (QObject*)CommonCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-liga", QSize(-1, h))); + else if (obj == (QObject*)ContextualCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-clig", QSize(-1, h))); + else if (obj == (QObject*)DiscretionaryCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-dlig", QSize(-1, h))); + else if (obj == (QObject*)HistoricalCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-hlig", QSize(-1, h))); + else if (obj == (QObject*)AllSmallCapsRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-c2sc-smcp", QSize(-1, h))); + else if (obj == (QObject*)SmallRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-smcp", QSize(-1, h))); + else if (obj == (QObject*)SmallFromCRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-c2sc", QSize(-1, h))); + else if (obj == (QObject*)AllPetiteCapsRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-p2pc-pcap", QSize(-1, h))); + else if (obj == (QObject*)PetiteRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-pcap", QSize(-1, h))); + else if (obj == (QObject*)PetiteCapRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-p2pc", QSize(-1, h))); + else if (obj == (QObject*)UnicaseRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-unic", QSize(-1, h))); + // else if (obj == (QObject*)TitlingRadio) + // fontPreview->setPixmap(im.loadPixmap("", QSize(-1, h))); + else if (obj == (QObject*)LiningRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-lnum", QSize(-1, h))); + else if (obj == (QObject*)OldStyleRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-onum", QSize(-1, h))); + else if (obj == (QObject*)ProportionalRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-pnum", QSize(-1, h))); + else if (obj == (QObject*)TabularRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-tnum", QSize(-1, h))); + else if (obj == (QObject*)DiagonalRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-frac", QSize(-1, h))); + else if (obj == (QObject*)StackedRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-afrc", QSize(-1, h))); + else if (obj == (QObject*)SubscriptRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-subs", QSize(-1, h))); + else if (obj == (QObject*)SuperscriptRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-sups", QSize(-1, h))); + else if (obj == (QObject*)OrdinalCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-ordn", QSize(-1, h))); + else if (obj == (QObject*)SlashedZeroCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-zero", QSize(-1, h))); + else + fontPreview->setPixmap(QPixmap()); +} + void PropertyWidget_FontFeatures::setDoc(ScribusDoc *d) { if ((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning())) @@ -297,6 +418,7 @@ { if (!m_ScMW || m_ScMW->scriptIsRunning()) return; + showFontFeatures(charStyle.fontFeatures(), charStyle.font().fontFeatures()); } @@ -324,7 +446,7 @@ connect(PetiteCapRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(AllPetiteCapsRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(UnicaseRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); - connect(TiltingRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); + connect(TitlingRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(DefaultStyleRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(LiningRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); @@ -382,7 +504,7 @@ disconnect(PetiteCapRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(AllPetiteCapsRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(UnicaseRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); - disconnect(TiltingRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); + disconnect(TitlingRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(DefaultStyleRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(LiningRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); @@ -468,11 +590,19 @@ disableAllFeatures(); + // Ligatures CommonCheck->setVisible(newFlags & FontFeatures::CommonLigatures); + labelCommonLigatures->setVisible(newFlags & FontFeatures::CommonLigatures); ContextualCheck->setVisible(newFlags & FontFeatures::ContextualLigatures); + labelContextualLigatures->setVisible(newFlags & FontFeatures::ContextualLigatures); DiscretionaryCheck->setVisible(newFlags & FontFeatures::DiscretionaryLigatures); + labelDiscretionaryLigatures->setVisible(newFlags & FontFeatures::DiscretionaryLigatures); HistoricalCheck->setVisible(newFlags & FontFeatures::HistoricalLigatures); + labelHistoricalLigatures->setVisible(newFlags & FontFeatures::HistoricalLigatures); + // Capitals + NormalCapRadio->setVisible(newFlags & FontFeatures::CapsMask); + labelCapitals->setVisible(newFlags & FontFeatures::CapsMask); SmallRadio->setVisible(newFlags & FontFeatures::SmallCaps); SmallFromCRadio->setVisible(newFlags & FontFeatures::SmallCapsFromCaps); AllSmallCapsRadio->setVisible((newFlags & FontFeatures::AllSmallCapsMask) == FontFeatures::AllSmallCapsMask); @@ -480,23 +610,38 @@ PetiteCapRadio->setVisible(newFlags & FontFeatures::PetiteCapsFromCaps); AllPetiteCapsRadio->setVisible((newFlags & FontFeatures::AllPetiteCapsMask) == FontFeatures::AllPetiteCapsMask); UnicaseRadio->setVisible(newFlags & FontFeatures::UnicaseCaps); - TiltingRadio->setVisible(newFlags & FontFeatures::TiltingCaps); + TitlingRadio->setVisible(newFlags & FontFeatures::TiltingCaps); + // Numeral Style + DefaultStyleRadio->setVisible(newFlags & FontFeatures::NumeralStyleMask); + labelNumeralStyle->setVisible(newFlags & FontFeatures::NumeralStyleMask); LiningRadio->setVisible(newFlags & FontFeatures::LiningNumerals); OldStyleRadio->setVisible(newFlags & FontFeatures::OldStyleNumerals); + // Numeral Width + DefaultWidthRadio->setVisible(newFlags & FontFeatures::NumeralWidthMask); + labelNumeralWidth->setVisible(newFlags & FontFeatures::NumeralWidthMask); ProportionalRadio->setVisible(newFlags & FontFeatures::ProportionalNumeralWidth); TabularRadio->setVisible(newFlags & FontFeatures::TabularNumeralWidth); + // Numeral Fractions + DefaultFractionsRadio->setVisible(newFlags & FontFeatures::NumeralFractionsMask); + labelFraction->setVisible(newFlags & FontFeatures::NumeralFractionsMask); DiagonalRadio->setVisible(newFlags & FontFeatures::DiagonalFractions); StackedRadio->setVisible(newFlags & FontFeatures::StackedFractions); + // Numeral Positions + DefaultPosRadio->setVisible(newFlags & FontFeatures::GlyphPositionMask); + LabelNumeralPosition->setVisible(newFlags & FontFeatures::GlyphPositionMask); SubscriptRadio->setVisible(newFlags & FontFeatures::Subscript); SuperscriptRadio->setVisible(newFlags & FontFeatures::Superscript); OrdinalCheck->setVisible(newFlags & FontFeatures::Ordinals); + // Numeral Slash Zero SlashedZeroCheck->setVisible(newFlags & FontFeatures::SlashedZero); + labelSlashedZero->setVisible(newFlags & FontFeatures::SlashedZero); + // Stylistic Sets StyleSet01->setVisible(newFlags & FontFeatures::StyleSet01); StyleSet02->setVisible(newFlags & FontFeatures::StyleSet02); StyleSet03->setVisible(newFlags & FontFeatures::StyleSet03); @@ -520,23 +665,29 @@ groupBox_7->setVisible(newFlags & FontFeatures::StyleSetsMask); - // Hide Default features when their relative ones aren't found in the font. - NormalCapRadio->setVisible(newFlags & FontFeatures::CapsMask); - DefaultStyleRadio->setVisible(newFlags & FontFeatures::NumeralStyleMask); - DefaultWidthRadio->setVisible(newFlags & FontFeatures::NumeralWidthMask); - DefaultFractionsRadio->setVisible(newFlags & FontFeatures::NumeralFractionsMask); - DefaultPosRadio->setVisible(newFlags & FontFeatures::GlyphPositionMask); + // Hide Headers + labelLigatures->setVisible(newFlags & FontFeatures::LigaturesMask); + labelLettercase->setVisible( + (newFlags & FontFeatures::CapsMask) || + (newFlags & FontFeatures::GlyphPositionMask) + ); + LabelNumbers->setVisible( + (newFlags & FontFeatures::NumeralStyleMask) || + (newFlags & FontFeatures::NumeralWidthMask) || + (newFlags & FontFeatures::NumeralFractionsMask) || + (newFlags & FontFeatures::SlashedZero) + ); + fontPreview->setVisible( + (newFlags & FontFeatures::LigaturesMask) || + (newFlags & FontFeatures::CapsMask) || + (newFlags & FontFeatures::NumeralStyleMask) || + (newFlags & FontFeatures::NumeralWidthMask) || + (newFlags & FontFeatures::NumeralFractionsMask) || + (newFlags & FontFeatures::GlyphPositionMask) || + (newFlags & FontFeatures::SlashedZero) || + (newFlags & FontFeatures::StyleSetsMask) + ); - // Hide Lines - line->setVisible(newFlags & FontFeatures::LigaturesMask); - - line_2->setVisible(newFlags & FontFeatures::CapsMask); - line_3->setVisible(newFlags & FontFeatures::NumeralStyleMask); - line_4->setVisible(newFlags & FontFeatures::NumeralWidthMask); - line_5->setVisible(newFlags & FontFeatures::NumeralFractionsMask); - line_6->setVisible(newFlags & FontFeatures::GlyphPositionMask); - line_7->setVisible(SlashedZeroCheck->isVisible()); - // Do not trigger item relayout unnecessarily, // that can hurt text typing speed if (oldFlags != featureFlags()) @@ -566,7 +717,7 @@ flags |= FontFeatures::PetiteCapsFromCaps; if (UnicaseRadio->isVisible()) flags |= FontFeatures::UnicaseCaps; - if (TiltingRadio->isVisible()) + if (TitlingRadio->isVisible()) flags |= FontFeatures::TiltingCaps; if (LiningRadio->isVisible()) @@ -657,6 +808,62 @@ void PropertyWidget_FontFeatures::initWidgets() { + fontPreview->setFixedHeight(50); + + CommonCheck->installEventFilter(this); + ContextualCheck->installEventFilter(this); + DiscretionaryCheck->installEventFilter(this); + HistoricalCheck->installEventFilter(this); + AllSmallCapsRadio->installEventFilter(this); + SmallRadio->installEventFilter(this); + SmallFromCRadio->installEventFilter(this); + AllPetiteCapsRadio->installEventFilter(this); + PetiteRadio->installEventFilter(this); + PetiteCapRadio->installEventFilter(this); + UnicaseRadio->installEventFilter(this); + TitlingRadio->installEventFilter(this); + LiningRadio->installEventFilter(this); + OldStyleRadio->installEventFilter(this); + ProportionalRadio->installEventFilter(this); + TabularRadio->installEventFilter(this); + DiagonalRadio->installEventFilter(this); + StackedRadio->installEventFilter(this); + SubscriptRadio->installEventFilter(this); + SuperscriptRadio->installEventFilter(this); + OrdinalCheck->installEventFilter(this); + SlashedZeroCheck->installEventFilter(this); + + QButtonGroup * groupCapitals = new QButtonGroup(); + groupCapitals->setExclusive(true); + groupCapitals->addButton(NormalCapRadio); + groupCapitals->addButton(SmallRadio); + groupCapitals->addButton(SmallFromCRadio); + groupCapitals->addButton(AllSmallCapsRadio); + groupCapitals->addButton(PetiteRadio); + groupCapitals->addButton(PetiteCapRadio); + groupCapitals->addButton(AllPetiteCapsRadio); + groupCapitals->addButton(UnicaseRadio); + groupCapitals->addButton(TitlingRadio); + + QButtonGroup * groupFractions = new QButtonGroup(); + groupFractions->setExclusive(true); + groupFractions->addButton(DefaultFractionsRadio); + groupFractions->addButton(DiagonalRadio); + groupFractions->addButton(StackedRadio); + + QButtonGroup * groupNumeralStyle = new QButtonGroup(); + groupNumeralStyle->setExclusive(true); + groupNumeralStyle->addButton(DefaultStyleRadio); + groupNumeralStyle->addButton(LiningRadio); + groupNumeralStyle->addButton(OldStyleRadio); + + QButtonGroup * groupNumeralWidth = new QButtonGroup(); + groupNumeralWidth->setExclusive(true); + groupNumeralWidth->addButton(DefaultWidthRadio); + groupNumeralWidth->addButton(ProportionalRadio); + groupNumeralWidth->addButton(TabularRadio); + + CommonCheck->setChecked(true); ContextualCheck->setChecked(true); DiscretionaryCheck->setChecked(false); @@ -663,31 +870,31 @@ HistoricalCheck->setChecked(false); NormalCapRadio->setChecked(true); - SmallRadio->setChecked(false); - SmallFromCRadio->setChecked(false); - AllSmallCapsRadio->setChecked(false); - PetiteRadio->setChecked(false); - PetiteCapRadio->setChecked(false); - AllPetiteCapsRadio->setChecked(false); - UnicaseRadio->setChecked(false); - TiltingRadio->setChecked(false); + // SmallRadio->setChecked(false); + // SmallFromCRadio->setChecked(false); + // AllSmallCapsRadio->setChecked(false); + // PetiteRadio->setChecked(false); + // PetiteCapRadio->setChecked(false); + // AllPetiteCapsRadio->setChecked(false); + // UnicaseRadio->setChecked(false); + // TitlingRadio->setChecked(false); DefaultStyleRadio->setChecked(true); - LiningRadio->setChecked(false); - OldStyleRadio->setChecked(false); + // LiningRadio->setChecked(false); + // OldStyleRadio->setChecked(false); DefaultWidthRadio->setChecked(true); - ProportionalRadio->setChecked(false); - TabularRadio->setChecked(false); + // ProportionalRadio->setChecked(false); + // TabularRadio->setChecked(false); DefaultFractionsRadio->setChecked(true); - DiagonalRadio->setChecked(false); - StackedRadio->setChecked(false); + // DiagonalRadio->setChecked(false); + // StackedRadio->setChecked(false); DefaultPosRadio->setChecked(true); - SubscriptRadio->setChecked(false); - SuperscriptRadio->setChecked(false); - OrdinalCheck->setChecked(false); + // SubscriptRadio->setChecked(false); + // SuperscriptRadio->setChecked(false); + // OrdinalCheck->setChecked(false); SlashedZeroCheck->setChecked(false); Index: scribus/ui/propertywidget_fontfeatures.h =================================================================== --- scribus/ui/propertywidget_fontfeatures.h (Revision 26312) +++ scribus/ui/propertywidget_fontfeatures.h (Arbeitskopie) @@ -7,8 +7,10 @@ #ifndef PROPERTYWIDGET_OPENTYPEFONTFEATURES_H #define PROPERTYWIDGET_OPENTYPEFONTFEATURES_H + #include "ui_propertywidget_fontfeaturesbase.h" #include "propertywidgetbase.h" +#include "fonts/scface.h" class CharStyle; class ParagraphStyle; @@ -34,9 +36,11 @@ void initWidgets(); void setCurrentItem(PageItem *item); void changeEvent(QEvent *e) override; + bool eventFilter(QObject *obj, QEvent *event) override; quint64 featureFlags() const; + // bool m_blockUpdate {false}; PageItem* m_item { nullptr }; ScribusMainWindow* m_ScMW { nullptr }; @@ -44,15 +48,34 @@ void setMainWindow(ScribusMainWindow *mw); void setDoc(ScribusDoc *d); void handleSelectionChanged(); + void iconSetChange(); void languageChange(); + void localeChange(); void unitChange() {} + void toggleLabelVisibility(bool v); + + // void showTextColors(const QString& strokeCol, double strokeShd); void showFontFeatures(const QString& s, const QStringList& availableFeatures); + // void showOutlineW(double x); + // void showShadowOffset(double x, double y); + // void showStrikeThru(double p, double w); + // void showTextEffects(int s); + // void showUnderline(double p, double w); + void updateCharStyle(const CharStyle& charStyle); void updateStyle(const ParagraphStyle& newCurrent); private slots: + // void handleOutlineWidth(); + // void handleShadowOffs(); + // void handleStrikeThru(); + // void handleTypeStyle(int s); + // void handleUnderline(); + // void handleTextOutline(); void handleFontFeatures(); + void handleFontPreview(QObject *obj); + signals: void needsRelayout(); }; Index: scribus/ui/propertywidget_fontfeaturesbase.ui =================================================================== --- scribus/ui/propertywidget_fontfeaturesbase.ui (Revision 26312) +++ scribus/ui/propertywidget_fontfeaturesbase.ui (Arbeitskopie) @@ -6,500 +6,883 @@ <rect> <x>0</x> <y>0</y> - <width>509</width> - <height>758</height> + <width>374</width> + <height>574</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> <property name="spacing"> - <number>3</number> + <number>4</number> </property> <property name="leftMargin"> - <number>3</number> + <number>8</number> </property> <property name="topMargin"> - <number>3</number> + <number>8</number> </property> <property name="rightMargin"> - <number>3</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>3</number> + <number>8</number> </property> <item> - <widget class="QCheckBox" name="CommonCheck"> - <property name="toolTip"> - <string>Common Ligatures (liga)</string> + <layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1"> + <property name="spacing"> + <number>4</number> </property> - <property name="text"> - <string>Common Ligatures</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> + <item row="3" column="0"> + <widget class="QLabel" name="labelContextualLigatures"> + <property name="text"> + <string>Contextual:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="11" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="DefaultWidthRadio"> + <property name="toolTip"> + <string>Default numbers width</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="ProportionalRadio"> + <property name="toolTip"> + <string>Proportional Figures (pnum)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="TabularRadio"> + <property name="toolTip"> + <string>Tabular Figures (tnum)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="labelHistoricalLigatures"> + <property name="text"> + <string>Historical:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="13" column="0"> + <widget class="QLabel" name="labelSlashedZero"> + <property name="text"> + <string>Slashed Zero:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="8" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="DefaultPosRadio"> + <property name="toolTip"> + <string>Normal position</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="SubscriptRadio"> + <property name="toolTip"> + <string>Subscript (subs)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="SuperscriptRadio"> + <property name="toolTip"> + <string>Superscript (sups)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="OrdinalCheck"> + <property name="toolTip"> + <string>Ordinals (ordn)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="3" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="Switch" name="ContextualCheck"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Contextual Ligatures (clig)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="7" column="0"> + <widget class="QLabel" name="labelCapitals"> + <property name="text"> + <string>Capitals:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="11" column="0"> + <widget class="QLabel" name="labelNumeralWidth"> + <property name="text"> + <string>Width:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="4" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_13"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="Switch" name="DiscretionaryCheck"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Discretionary Ligatures (dlig)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_10"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="9" column="0" colspan="2"> + <widget class="QLabel" name="LabelNumbers"> + <property name="font"> + <font> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Numerals</string> + </property> + </widget> + </item> + <item row="13" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_11"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="Switch" name="SlashedZeroCheck"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Slashed Zero (zero)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_8"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="labelDiscretionaryLigatures"> + <property name="text"> + <string>Discretionary:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="8" column="0"> + <widget class="QLabel" name="LabelNumeralPosition"> + <property name="text"> + <string>Position:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="6" column="0" colspan="2"> + <widget class="QLabel" name="labelLettercase"> + <property name="font"> + <font> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Capitals & Position</string> + </property> + </widget> + </item> + <item row="7" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="NormalCapRadio"> + <property name="toolTip"> + <string>Normal capitals</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="SmallRadio"> + <property name="toolTip"> + <string>Small capitals (smcp)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="SmallFromCRadio"> + <property name="toolTip"> + <string>Small capitals from capitals (c2sc)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="AllSmallCapsRadio"> + <property name="toolTip"> + <string>All Small Caps (c2sc + smcp)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="PetiteRadio"> + <property name="toolTip"> + <string>Petite capitals (pcap)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="PetiteCapRadio"> + <property name="toolTip"> + <string>Petite capitals from capitals (c2pc)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="AllPetiteCapsRadio"> + <property name="toolTip"> + <string>All Petite Caps (c2pc + pcap)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="UnicaseRadio"> + <property name="toolTip"> + <string>Unicase (unic)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="TitlingRadio"> + <property name="toolTip"> + <string>Titling (titl)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="5" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_14"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="Switch" name="HistoricalCheck"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Historical Ligatures (hlig)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_11"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="10" column="0"> + <widget class="QLabel" name="labelNumeralStyle"> + <property name="text"> + <string>Style:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="12" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="DefaultFractionsRadio"> + <property name="toolTip"> + <string>No fractions</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="DiagonalRadio"> + <property name="toolTip"> + <string>Fractions (frac)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="StackedRadio"> + <property name="toolTip"> + <string>Alternative Fractions (afrc)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="2" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="Switch" name="CommonCheck"> + <property name="minimumSize"> + <size> + <width>24</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Common Ligatures (liga)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="12" column="0"> + <widget class="QLabel" name="labelFraction"> + <property name="text"> + <string>Fractions:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="10" column="1"> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="spacing"> + <number>4</number> + </property> + <item> + <widget class="QToolButton" name="DefaultStyleRadio"> + <property name="toolTip"> + <string>Default numbers style</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="LiningRadio"> + <property name="toolTip"> + <string>Lining Figures (lnum)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="OldStyleRadio"> + <property name="toolTip"> + <string>Oldstyle Figures (onum)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="autoExclusive"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="labelCommonLigatures"> + <property name="text"> + <string>Common:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="1" column="0" colspan="2"> + <widget class="QLabel" name="labelLigatures"> + <property name="font"> + <font> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Ligatures</string> + </property> + </widget> + </item> + <item row="0" column="0" colspan="2"> + <widget class="QLabel" name="fontPreview"> + <property name="frameShape"> + <enum>QFrame::Shape::StyledPanel</enum> + </property> + <property name="text"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignCenter</set> + </property> + </widget> + </item> + </layout> </item> <item> - <widget class="QCheckBox" name="ContextualCheck"> - <property name="toolTip"> - <string>Contextual Ligatures (clig)</string> + <widget class="QGroupBox" name="groupBox_7"> + <property name="font"> + <font> + <bold>true</bold> + </font> </property> - <property name="text"> - <string>Contextual Ligatures</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <property name="autoRepeat"> - <bool>false</bool> - </property> - <property name="autoExclusive"> - <bool>false</bool> - </property> - <property name="tristate"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="DiscretionaryCheck"> - <property name="toolTip"> - <string>Discretionary Ligatures (dlig)</string> - </property> - <property name="text"> - <string>Discretionary Ligatures</string> - </property> - <property name="autoExclusive"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="HistoricalCheck"> - <property name="toolTip"> - <string>Historical Ligatures (hlig)</string> - </property> - <property name="text"> - <string>Historical Ligatures</string> - </property> - <property name="checked"> - <bool>false</bool> - </property> - <property name="autoExclusive"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="NormalCapRadio"> - <property name="toolTip"> - <string>Normal capitals</string> - </property> - <property name="text"> - <string>Default Capitals</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <attribute name="buttonGroup"> - <string notr="true">CapitalsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="SmallRadio"> - <property name="toolTip"> - <string>Small capitals (smcp)</string> - </property> - <property name="text"> - <string>Small Capitals</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">CapitalsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="SmallFromCRadio"> - <property name="toolTip"> - <string>Small capitals from capitals (c2sc)</string> - </property> - <property name="text"> - <string>Small Capitals from Capitals</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">CapitalsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="AllSmallCapsRadio"> - <property name="text"> - <string>All Small Caps</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">CapitalsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="PetiteRadio"> - <property name="toolTip"> - <string>Petite capitals (pcap)</string> - </property> - <property name="text"> - <string>Petite Capitals</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">CapitalsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="PetiteCapRadio"> - <property name="toolTip"> - <string>Petite capitals from capitals (c2pc)</string> - </property> - <property name="text"> - <string>Petite Capitals from Capitals</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">CapitalsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="AllPetiteCapsRadio"> - <property name="text"> - <string>All Petite Caps</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">CapitalsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="UnicaseRadio"> - <property name="toolTip"> - <string>Unicase (unic)</string> - </property> - <property name="text"> - <string>Unicase</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">CapitalsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="TiltingRadio"> - <property name="toolTip"> - <string>Titling (titl)</string> - </property> - <property name="text"> - <string>Titling</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">CapitalsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="Line" name="line_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="DefaultStyleRadio"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Default numbers style</string> - </property> - <property name="text"> - <string>Default Numerals</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <attribute name="buttonGroup"> - <string notr="true">NumeralStyleGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="LiningRadio"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Lining Figures (lnum)</string> - </property> - <property name="text"> - <string>Lining</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">NumeralStyleGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="OldStyleRadio"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Oldstyle Figures (onum)</string> - </property> - <property name="text"> - <string>Old Style</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">NumeralStyleGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="Line" name="line_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="DefaultWidthRadio"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Default numbers width</string> - </property> - <property name="text"> - <string>Default Numeral Width</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <attribute name="buttonGroup"> - <string notr="true">NumeralWidthGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="ProportionalRadio"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Proportional Figures (pnum)</string> - </property> - <property name="text"> - <string>Proportional</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">NumeralWidthGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="TabularRadio"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Tabular Figures (tnum)</string> - </property> - <property name="text"> - <string>Tabular</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">NumeralWidthGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="Line" name="line_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="DefaultFractionsRadio"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>No fractions</string> - </property> - <property name="text"> - <string>No Fractions</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <attribute name="buttonGroup"> - <string notr="true">FractionsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="DiagonalRadio"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Fractions (frac)</string> - </property> - <property name="text"> - <string>Diagonal Fractions</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">FractionsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="StackedRadio"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Alternative Fractions (afrc)</string> - </property> - <property name="text"> - <string>Stacked Fractions</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">FractionsGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="Line" name="line_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="DefaultPosRadio"> - <property name="toolTip"> - <string>Normal position</string> - </property> - <property name="text"> - <string>Default Position</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <attribute name="buttonGroup"> - <string notr="true">PositionGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="SubscriptRadio"> - <property name="toolTip"> - <string>Subscript (subs)</string> - </property> - <property name="text"> - <string>Subscript</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">PositionGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="SuperscriptRadio"> - <property name="toolTip"> - <string>Superscript (sups)</string> - </property> - <property name="text"> - <string>Superscript</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">PositionGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="OrdinalCheck"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Ordinals (ordn)</string> - </property> - <property name="text"> - <string>Ordinals</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">PositionGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="Line" name="line_6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="SlashedZeroCheck"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Slashed Zero (zero)</string> - </property> - <property name="text"> - <string>Slashed Zero</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_7"> <property name="title"> <string>Stylistic sets</string> </property> <layout class="QGridLayout" name="gridLayout"> <property name="leftMargin"> - <number>6</number> + <number>8</number> </property> <property name="topMargin"> - <number>6</number> + <number>8</number> </property> <property name="rightMargin"> - <number>6</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>6</number> + <number>8</number> </property> <property name="spacing"> - <number>3</number> + <number>4</number> </property> <item row="0" column="0"> <widget class="QCheckBox" name="StyleSet01"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>1</string> </property> @@ -507,6 +890,11 @@ </item> <item row="0" column="1"> <widget class="QCheckBox" name="StyleSet05"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>5</string> </property> @@ -514,6 +902,11 @@ </item> <item row="0" column="2"> <widget class="QCheckBox" name="StyleSet09"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>9</string> </property> @@ -521,6 +914,11 @@ </item> <item row="0" column="3"> <widget class="QCheckBox" name="StyleSet13"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>13</string> </property> @@ -528,6 +926,11 @@ </item> <item row="0" column="4"> <widget class="QCheckBox" name="StyleSet17"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>17</string> </property> @@ -535,6 +938,11 @@ </item> <item row="1" column="0"> <widget class="QCheckBox" name="StyleSet02"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>2</string> </property> @@ -542,6 +950,11 @@ </item> <item row="1" column="1"> <widget class="QCheckBox" name="StyleSet06"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>6</string> </property> @@ -549,6 +962,11 @@ </item> <item row="1" column="2"> <widget class="QCheckBox" name="StyleSet10"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>10</string> </property> @@ -556,6 +974,11 @@ </item> <item row="1" column="3"> <widget class="QCheckBox" name="StyleSet14"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>14</string> </property> @@ -563,6 +986,11 @@ </item> <item row="1" column="4"> <widget class="QCheckBox" name="StyleSet18"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>18</string> </property> @@ -570,6 +998,11 @@ </item> <item row="2" column="0"> <widget class="QCheckBox" name="StyleSet03"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>3</string> </property> @@ -577,6 +1010,11 @@ </item> <item row="2" column="1"> <widget class="QCheckBox" name="StyleSet07"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>7</string> </property> @@ -584,6 +1022,11 @@ </item> <item row="2" column="2"> <widget class="QCheckBox" name="StyleSet11"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>11</string> </property> @@ -591,6 +1034,11 @@ </item> <item row="2" column="3"> <widget class="QCheckBox" name="StyleSet15"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>15</string> </property> @@ -598,6 +1046,11 @@ </item> <item row="2" column="4"> <widget class="QCheckBox" name="StyleSet19"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>19</string> </property> @@ -605,6 +1058,11 @@ </item> <item row="3" column="0"> <widget class="QCheckBox" name="StyleSet04"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>4</string> </property> @@ -612,6 +1070,11 @@ </item> <item row="3" column="1"> <widget class="QCheckBox" name="StyleSet08"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>8</string> </property> @@ -619,6 +1082,11 @@ </item> <item row="3" column="2"> <widget class="QCheckBox" name="StyleSet12"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>12</string> </property> @@ -626,6 +1094,11 @@ </item> <item row="3" column="3"> <widget class="QCheckBox" name="StyleSet16"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>16</string> </property> @@ -633,6 +1106,11 @@ </item> <item row="3" column="4"> <widget class="QCheckBox" name="StyleSet20"> + <property name="font"> + <font> + <bold>false</bold> + </font> + </property> <property name="text"> <string>20</string> </property> @@ -643,13 +1121,62 @@ </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>Switch</class> + <extends>QToolButton</extends> + <header>ui/widgets/switch.h</header> + </customwidget> + </customwidgets> + <tabstops> + <tabstop>CommonCheck</tabstop> + <tabstop>ContextualCheck</tabstop> + <tabstop>DiscretionaryCheck</tabstop> + <tabstop>HistoricalCheck</tabstop> + <tabstop>NormalCapRadio</tabstop> + <tabstop>SmallRadio</tabstop> + <tabstop>SmallFromCRadio</tabstop> + <tabstop>AllSmallCapsRadio</tabstop> + <tabstop>PetiteRadio</tabstop> + <tabstop>PetiteCapRadio</tabstop> + <tabstop>AllPetiteCapsRadio</tabstop> + <tabstop>UnicaseRadio</tabstop> + <tabstop>TitlingRadio</tabstop> + <tabstop>DefaultPosRadio</tabstop> + <tabstop>SubscriptRadio</tabstop> + <tabstop>SuperscriptRadio</tabstop> + <tabstop>OrdinalCheck</tabstop> + <tabstop>DefaultStyleRadio</tabstop> + <tabstop>LiningRadio</tabstop> + <tabstop>OldStyleRadio</tabstop> + <tabstop>DefaultWidthRadio</tabstop> + <tabstop>ProportionalRadio</tabstop> + <tabstop>TabularRadio</tabstop> + <tabstop>DefaultFractionsRadio</tabstop> + <tabstop>DiagonalRadio</tabstop> + <tabstop>StackedRadio</tabstop> + <tabstop>SlashedZeroCheck</tabstop> + <tabstop>StyleSet01</tabstop> + <tabstop>StyleSet02</tabstop> + <tabstop>StyleSet03</tabstop> + <tabstop>StyleSet04</tabstop> + <tabstop>StyleSet05</tabstop> + <tabstop>StyleSet06</tabstop> + <tabstop>StyleSet07</tabstop> + <tabstop>StyleSet08</tabstop> + <tabstop>StyleSet09</tabstop> + <tabstop>StyleSet10</tabstop> + <tabstop>StyleSet11</tabstop> + <tabstop>StyleSet12</tabstop> + <tabstop>StyleSet13</tabstop> + <tabstop>StyleSet14</tabstop> + <tabstop>StyleSet15</tabstop> + <tabstop>StyleSet16</tabstop> + <tabstop>StyleSet17</tabstop> + <tabstop>StyleSet18</tabstop> + <tabstop>StyleSet19</tabstop> + <tabstop>StyleSet20</tabstop> + </tabstops> <resources/> <connections/> - <buttongroups> - <buttongroup name="PositionGroup"/> - <buttongroup name="CapitalsGroup"/> - <buttongroup name="FractionsGroup"/> - <buttongroup name="NumeralStyleGroup"/> - <buttongroup name="NumeralWidthGroup"/> - </buttongroups> </ui> Index: scribus/ui/propertywidget_hyphenation.cpp =================================================================== --- scribus/ui/propertywidget_hyphenation.cpp (Revision 26312) +++ scribus/ui/propertywidget_hyphenation.cpp (Arbeitskopie) @@ -10,8 +10,11 @@ #include "propertywidget_hyphenation.h" #include "appmodes.h" +#include "iconmanager.h" +#include "langmgr.h" #include "pageitem_table.h" #include "scribus.h" +#include "scribusapp.h" #include "scribusdoc.h" #include "selection.h" @@ -21,8 +24,18 @@ setupUi(this); hyphenCharLineEdit->setMaxLength(1); - layout()->setAlignment( Qt::AlignTop ); + hyphenCharLineEdit->setFixedWidth(30); + + labelSmallestWord->setLabelVisibility(false); + labelConsecutiveHyphens->setLabelVisibility(false); + labelCharacter->setLabelVisibility(false); + labelLanguage->setLabelVisibility(false); + + iconSetChange(); languageChange(); + + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void PropertyWidget_Hyphenation::setMainWindow(ScribusMainWindow *mw) @@ -43,6 +56,17 @@ void PropertyWidget_Hyphenation::languageChange() { retranslateUi(this); + + QSignalBlocker langComboBlocker(langCombo); + QStringList languageList; + LanguageManager::instance()->fillInstalledStringList(&languageList); + int oldLang = langCombo->currentIndex(); + langCombo->clear(); + langCombo->addItems(languageList); + langCombo->setCurrentIndex(oldLang); + + QSignalBlocker smallestWordBlocker(smallestWordSpinBox); + smallestWordSpinBox->setSuffix(tr(" characters")); } void PropertyWidget_Hyphenation::handleWordMin(int minWord) @@ -76,11 +100,27 @@ hyphenChar = 0; else hyphenChar = hyphenText.toUcs4()[0]; - qDebug() << hyphenChar; + tempSelection.addItem(m_item, true); m_doc->itemSelection_SetHyphenChar(hyphenChar, &tempSelection); } +void PropertyWidget_Hyphenation::handleHyphenate() +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + + m_doc->itemSelection_DoHyphenate(); +} + +void PropertyWidget_Hyphenation::handleDehyphenate() +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + + m_doc->itemSelection_DoDeHyphenate(); +} + void PropertyWidget_Hyphenation::setDoc(ScribusDoc *d) { if ((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning())) @@ -116,6 +156,23 @@ update(); } +void PropertyWidget_Hyphenation::toggleLabelVisibility(bool v) +{ + // labelSmallestWord->setLabelVisibility(v); + // labelConsecutiveHyphens->setLabelVisibility(v); + // labelCharacter->setLabelVisibility(v); + // labelLanguage->setLabelVisibility(v); +} + +void PropertyWidget_Hyphenation::iconSetChange() +{ + IconManager& im = IconManager::instance(); + labelLanguage->setPixmap(im.loadPixmap("paragraph-language")); + labelSmallestWord->setPixmap(im.loadPixmap("hyphen-smallest-word")); + labelConsecutiveHyphens->setPixmap(im.loadPixmap("hyphen-consecutive")); + labelCharacter->setPixmap(im.loadPixmap("hyphen-character")); +} + void PropertyWidget_Hyphenation::updateCharStyle(const CharStyle& charStyle) { if (!m_ScMW || m_ScMW->scriptIsRunning()) @@ -130,6 +187,8 @@ if (hyphenChar) hyphenText = QString::fromUcs4(&hyphenChar, 1); hyphenCharLineEdit->setText(hyphenText); + + showLanguage(charStyle.language()); } void PropertyWidget_Hyphenation::updateStyle(const ParagraphStyle& paraStyle) @@ -139,16 +198,45 @@ const CharStyle& charStyle = paraStyle.charStyle(); updateCharStyle(charStyle); + showLanguage(charStyle.language()); QSignalBlocker blocker(maxConsecutiveCountSpinBox); maxConsecutiveCountSpinBox->setValue(paraStyle.hyphenConsecutiveLines()); } +void PropertyWidget_Hyphenation::showLanguage(const QString &w) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + QStringList lang; + LanguageManager::instance()->fillInstalledStringList(&lang); + QString langName = LanguageManager::instance()->getLangFromAbbrev(w, true); + + bool sigBlocked = langCombo->blockSignals(true); + langCombo->setCurrentIndex(lang.indexOf(langName)); + langCombo->blockSignals(sigBlocked); +} + +void PropertyWidget_Hyphenation::changeLang(int id) +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + QStringList languageList; + LanguageManager::instance()->fillInstalledStringList(&languageList); + QString abrv = LanguageManager::instance()->getAbbrevFromLang(languageList.value(id),false); + Selection tempSelection(this, false); + tempSelection.addItem(m_item, true); + m_doc->itemSelection_SetLanguage(abrv, &tempSelection); +} + void PropertyWidget_Hyphenation::connectSignals() { connect(smallestWordSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleWordMin(int))); connect(maxConsecutiveCountSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleConsecutiveLines(int))); connect(hyphenCharLineEdit, SIGNAL(textChanged(QString)), this, SLOT(handleHyphenChar(QString))); + connect(langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeLang(int))); + connect(hyphenateButton, SIGNAL(clicked()), this, SLOT(handleHyphenate())); + connect(dehyphenateButton, SIGNAL(clicked()), this, SLOT(handleDehyphenate())); } void PropertyWidget_Hyphenation::disconnectSignals() @@ -156,6 +244,9 @@ disconnect(smallestWordSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleWordMin(int))); disconnect(maxConsecutiveCountSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleConsecutiveLines(int))); disconnect(hyphenCharLineEdit, SIGNAL(textChanged(QString)), this, SLOT(handleHyphenChar(QString))); + disconnect(langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeLang(int))); + disconnect(hyphenateButton, SIGNAL(clicked()), this, SLOT(handleHyphenate())); + disconnect(dehyphenateButton, SIGNAL(clicked()), this, SLOT(handleDehyphenate())); } void PropertyWidget_Hyphenation::configureWidgets() @@ -163,8 +254,14 @@ bool enabled = false; if (m_item && m_doc) { - if (m_item->isPathText() || m_item->isTextFrame() || m_item->isTable()) - enabled = true; + if (m_item->isTextFrame() || m_item->isPathText() || m_item->isTable()) + { + PageItem_TextFrame *textItem = m_item->asTextFrame(); + if (m_doc->appMode == modeEditTable) + textItem = m_item->asTable()->activeCell().textFrame(); + if (textItem) + enabled = true; + } if ((m_item->isGroup()) && (!m_item->isSingleSel)) enabled = false; if (m_item->isOSGFrame() || m_item->isSymbol()) @@ -188,17 +285,18 @@ disconnectSignals(); configureWidgets(); - if (m_item) + if (!m_item) + return; + + if (m_item->isTextFrame() || m_item->isPathText() || m_item->isTable()) { - if (m_item->isTextFrame() || m_item->isPathText() || m_item->isTable()) - { - ParagraphStyle parStyle = m_item->itemText.defaultStyle(); - if (m_doc->appMode == modeEdit) - m_item->currentTextProps(parStyle); - else if (m_doc->appMode == modeEditTable) - m_item->asTable()->activeCell().textFrame()->currentTextProps(parStyle); - updateStyle(parStyle); - } - connectSignals(); + ParagraphStyle parStyle = m_item->itemText.defaultStyle(); + if (m_doc->appMode == modeEdit) + m_item->currentTextProps(parStyle); + else if (m_doc->appMode == modeEditTable) + m_item->asTable()->activeCell().textFrame()->currentTextProps(parStyle); + updateStyle(parStyle); } + connectSignals(); + } Index: scribus/ui/propertywidget_hyphenation.h =================================================================== --- scribus/ui/propertywidget_hyphenation.h (Revision 26312) +++ scribus/ui/propertywidget_hyphenation.h (Arbeitskopie) @@ -39,15 +39,21 @@ void setMainWindow(ScribusMainWindow *mw); void setDoc(ScribusDoc *d); void handleSelectionChanged(); + void toggleLabelVisibility(bool v); + void iconSetChange(); void languageChange(); void unitChange() {}; void updateCharStyle(const CharStyle& charStyle); void updateStyle(const ParagraphStyle& paraStyle); + void showLanguage(const QString& w); + void changeLang(int id); private slots: void handleWordMin(int minWord); void handleConsecutiveLines(int consecutiveLines); void handleHyphenChar(const QString& hyphenText); + void handleHyphenate(); + void handleDehyphenate(); }; #endif // PROPERTYWIDGET_HYPHENATION_H Index: scribus/ui/propertywidget_hyphenationbase.ui =================================================================== --- scribus/ui/propertywidget_hyphenationbase.ui (Revision 26312) +++ scribus/ui/propertywidget_hyphenationbase.ui (Arbeitskopie) @@ -6,64 +6,80 @@ <rect> <x>0</x> <y>0</y> - <width>305</width> - <height>95</height> + <width>332</width> + <height>163</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> <property name="spacing"> - <number>3</number> + <number>8</number> </property> <property name="leftMargin"> - <number>3</number> + <number>8</number> </property> <property name="topMargin"> - <number>3</number> + <number>8</number> </property> <property name="rightMargin"> - <number>3</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>3</number> + <number>8</number> </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> + <layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,1"> <property name="spacing"> - <number>3</number> + <number>16</number> </property> <item> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Smallest Word:</string> + <widget class="FormWidget" name="labelLanguage"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="smallestWordSpinBox"> - <property name="toolTip"> - <string>Length of the smallest word to be hyphenated</string> + <property name="label" stdset="0"> + <string>Language</string> </property> - <property name="minimum"> - <number>3</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QComboBox" name="langCombo"> + <property name="toolTip"> + <string>Text Language</string> + </property> + <property name="editable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Characters</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> + <spacer name="horizontalSpacer_2"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> - <height>20</height> + <width>0</width> + <height>0</height> </size> </property> </spacer> @@ -71,50 +87,274 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0,1"> <property name="spacing"> - <number>3</number> + <number>16</number> </property> <item> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Consecutive Hyphenations Allowed:</string> + <widget class="FormWidget" name="labelSmallestWord"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> + <property name="label" stdset="0"> + <string>Smallest Word</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QSpinBox" name="smallestWordSpinBox"> + <property name="toolTip"> + <string>Length of the smallest word to be hyphenated</string> + </property> + <property name="suffix"> + <string> characters</string> + </property> + <property name="minimum"> + <number>3</number> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> </widget> </item> <item> - <widget class="QSpinBox" name="maxConsecutiveCountSpinBox"> - <property name="toolTip"> - <string>Maximum number of Hyphenations following each other. -A value of 0 means unlimited hyphenations.</string> + <widget class="FormWidget" name="labelCharacter"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> + <property name="label" stdset="0"> + <string>Character</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLineEdit" name="hyphenCharLineEdit"> + <property name="toolTip"> + <string>The character used for automatic hyphen. Can be empty.</string> + </property> + <property name="maxLength"> + <number>1</number> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_8"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> </widget> </item> + <item> + <widget class="FormWidget" name="labelConsecutiveHyphens"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Consecutive</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QSpinBox" name="maxConsecutiveCountSpinBox"> + <property name="toolTip"> + <string>Maximum number of Hyphenations following each other. +A value of 0 means unlimited hyphenations.</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> + <layout class="QHBoxLayout" name="horizontalLayout_7"> <property name="spacing"> - <number>3</number> + <number>8</number> </property> <item> - <widget class="QLabel" name="label_4"> + <widget class="QPushButton" name="hyphenateButton"> + <property name="toolTip"> + <string>Hyphenate text</string> + </property> <property name="text"> - <string>Hyphenation Character:</string> + <string>Hyphenate</string> </property> </widget> </item> <item> - <widget class="QLineEdit" name="hyphenCharLineEdit"> + <widget class="QPushButton" name="dehyphenateButton"> <property name="toolTip"> - <string>The character used for automatic hyphen. Can be empty.</string> + <string>Dehyphenate text</string> </property> + <property name="text"> + <string>Dehyphenate</string> + </property> </widget> </item> + <item> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> </layout> </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> Index: scribus/ui/propertywidget_optmargins.cpp =================================================================== --- scribus/ui/propertywidget_optmargins.cpp (Revision 26312) +++ scribus/ui/propertywidget_optmargins.cpp (nicht existent) @@ -1,214 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ - -#include "propertywidget_optmargins.h" - -#include "appmodehelper.h" -#include "appmodes.h" -#include "pageitem_table.h" -#include "scribus.h" -#include "scribusdoc.h" -#include "selection.h" - - -PropertyWidget_OptMargins::PropertyWidget_OptMargins(QWidget* parent) : QFrame(parent) -{ - setupUi(this); - - layout()->setAlignment(Qt::AlignTop); - - languageChange(); -} - -void PropertyWidget_OptMargins::setMainWindow(ScribusMainWindow* mw) -{ - m_ScMW = mw; - - connect(m_ScMW->appModeHelper, SIGNAL(AppModeChanged(int,int)), this, SLOT(handleAppModeChanged(int,int))); - connect(m_ScMW, SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int))); -} - -void PropertyWidget_OptMargins::setDoc(ScribusDoc *d) -{ - if ((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning())) - return; - - if (m_doc) - { - disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); - disconnect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); - } - - m_doc = d; - m_item = nullptr; - - if (m_doc.isNull()) - { - disconnectSignals(); - return; - } - - connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); - connect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); -} - -void PropertyWidget_OptMargins::setCurrentItem(PageItem *item) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - //CB We shouldn't really need to process this if our item is the same one - //maybe we do if the item has been changed by scripter.. but that should probably - //set some status if so. - //FIXME: This won't work until when a canvas deselect happens, m_item must be nullptr. - //if (m_item == i) - // return; - - if (item && m_doc.isNull()) - setDoc(item->doc()); - - m_item = item; - - disconnectSignals(); - configureWidgets(); - - if (m_item) - { - if (m_item->isTextFrame() || m_item->isPathText()) - { - ParagraphStyle parStyle = m_item->itemText.defaultStyle(); - if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable) - m_item->currentTextProps(parStyle); - showOpticalMargins(parStyle); - } - - connectSignals(); - } -} - -void PropertyWidget_OptMargins::connectSignals() -{ - connect(optMarginRadioNone , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - connect(optMarginRadioBoth , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - connect(optMarginRadioLeft , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - connect(optMarginRadioRight , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - connect(optMarginResetButton, SIGNAL(clicked()), this, SLOT(resetOpticalMargins()) ); -} - -void PropertyWidget_OptMargins::disconnectSignals() -{ - disconnect(optMarginRadioNone , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - disconnect(optMarginRadioBoth , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - disconnect(optMarginRadioLeft , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - disconnect(optMarginRadioRight , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - disconnect(optMarginResetButton, SIGNAL(clicked()), this, SLOT(resetOpticalMargins()) ); -} - -void PropertyWidget_OptMargins::configureWidgets() -{ - bool enabled = false; - if (m_item && m_doc) - { - PageItem_TextFrame* textItem = m_item->asTextFrame(); - if (m_doc->appMode == modeEditTable) - textItem = m_item->asTable()->activeCell().textFrame(); - - enabled = (m_item->isPathText() || (textItem != nullptr)); - enabled &= (m_doc->m_Selection->count() == 1); - } - setEnabled(enabled); -} - -void PropertyWidget_OptMargins::handleAppModeChanged(int oldMode, int mode) -{ - if (oldMode == modeEditTable || mode == modeEditTable) - { - setCurrentItem(m_item); - } -} - -void PropertyWidget_OptMargins::handleSelectionChanged() -{ - if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - - PageItem* currItem = currentItemFromSelection(); - setCurrentItem(currItem); - updateGeometry(); -} - -void PropertyWidget_OptMargins::showOpticalMargins(const ParagraphStyle & pStyle) -{ - ParagraphStyle::OpticalMarginType omt(static_cast<ParagraphStyle::OpticalMarginType>(pStyle.opticalMargins())); - bool blocked = optMarginRadioBoth->blockSignals(true); - if (omt == ParagraphStyle::OM_Default) - optMarginRadioBoth->setChecked(true); - else if (omt == ParagraphStyle::OM_LeftHangingPunct) - optMarginRadioLeft->setChecked(true); - else if (omt == ParagraphStyle::OM_RightHangingPunct) - optMarginRadioRight->setChecked(true); - else - optMarginRadioNone->setChecked(true); - optMarginRadioBoth->blockSignals(blocked); -} - -void PropertyWidget_OptMargins::updateStyle(const ParagraphStyle& newCurrent) -{ - showOpticalMargins(newCurrent); -} - -void PropertyWidget_OptMargins::handleOpticalMargins() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - int omt(ParagraphStyle::OM_None); - if (optMarginRadioBoth->isChecked()) - omt = ParagraphStyle::OM_Default; - else if (optMarginRadioLeft->isChecked()) - omt = ParagraphStyle::OM_LeftHangingPunct; - else if (optMarginRadioRight->isChecked()) - omt = ParagraphStyle::OM_RightHangingPunct; - - PageItem *item = m_item; - if (m_doc->appMode == modeEditTable) - item = m_item->asTable()->activeCell().textFrame(); - if (item != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(item, true); - m_doc->itemSelection_SetOpticalMargins(omt, &tempSelection); - } -} - -void PropertyWidget_OptMargins::resetOpticalMargins() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *item = m_item; - if (m_doc->appMode == modeEditTable) - item = m_item->asTable()->activeCell().textFrame(); - if (item != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(item, true); - m_doc->itemSelection_resetOpticalMargins(&tempSelection); - } -} - -void PropertyWidget_OptMargins::changeEvent(QEvent *e) -{ - if (e->type() == QEvent::LanguageChange) - { - languageChange(); - return; - } - QWidget::changeEvent(e); -} - -void PropertyWidget_OptMargins::languageChange() -{ - retranslateUi(this); -} Index: scribus/ui/propertywidget_optmargins.h =================================================================== --- scribus/ui/propertywidget_optmargins.h (Revision 26312) +++ scribus/ui/propertywidget_optmargins.h (nicht existent) @@ -1,59 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ -#ifndef PROPERTYWIDGET_OPTMARGINS_H -#define PROPERTYWIDGET_OPTMARGINS_H - -#include "ui_propertywidget_optmarginsbase.h" - -#include "propertywidgetbase.h" - -class ParagraphStyle; -class ScribusDoc; -class ScribusMainWindow; - -class PropertyWidget_OptMargins : public QFrame, public Ui::PropertyWidget_OptMarginsBase, - public PropertyWidgetBase -{ - Q_OBJECT - -public: - PropertyWidget_OptMargins(QWidget* parent); - ~PropertyWidget_OptMargins() {}; - - void updateStyle(const ParagraphStyle& newCurrent); - -protected: - PageItem * m_item { nullptr }; - ScribusMainWindow* m_ScMW { nullptr }; - - void connectSignals(); - void disconnectSignals(); - - void configureWidgets(); - void setCurrentItem(PageItem *item); - - void changeEvent(QEvent *e) override; - -public slots: - void setMainWindow(ScribusMainWindow *mw); - void setDoc(ScribusDoc *d); - - void handleAppModeChanged(int oldMode, int mode); - void handleSelectionChanged(); - void handleUpdateRequest(int) {}; - - void languageChange(); - void unitChange() {}; - - void showOpticalMargins(const ParagraphStyle& pStyle); - -private slots: - void handleOpticalMargins(); - void resetOpticalMargins(); -}; - -#endif Index: scribus/ui/propertywidget_optmarginsbase.ui =================================================================== --- scribus/ui/propertywidget_optmarginsbase.ui (Revision 26312) +++ scribus/ui/propertywidget_optmarginsbase.ui (nicht existent) @@ -1,68 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>PropertyWidget_OptMarginsBase</class> - <widget class="QFrame" name="PropertyWidget_OptMarginsBase"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>210</width> - <height>137</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>3</number> - </property> - <property name="topMargin"> - <number>3</number> - </property> - <property name="rightMargin"> - <number>3</number> - </property> - <property name="bottomMargin"> - <number>3</number> - </property> - <item> - <widget class="QRadioButton" name="optMarginRadioNone"> - <property name="text"> - <string>None</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="optMarginRadioBoth"> - <property name="text"> - <string>Both Sides</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="optMarginRadioLeft"> - <property name="text"> - <string>Left Only</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="optMarginRadioRight"> - <property name="text"> - <string>Right Only</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="optMarginResetButton"> - <property name="text"> - <string>Reset</string> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> Index: scribus/ui/propertywidget_orphans.cpp =================================================================== --- scribus/ui/propertywidget_orphans.cpp (Revision 26312) +++ scribus/ui/propertywidget_orphans.cpp (Arbeitskopie) @@ -7,7 +7,8 @@ #include "propertywidget_orphans.h" - +#include "iconmanager.h" +#include "scribusapp.h" #include "scribusdoc.h" PropertyWidget_Orphans::PropertyWidget_Orphans(QWidget* parent) : QFrame(parent) @@ -18,7 +19,10 @@ keepLinesStart->setDecimals(0); keepLinesEnd->setDecimals(0); + iconSetChange(); languageChange(); + + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); } void PropertyWidget_Orphans::connectSignals() @@ -89,6 +93,14 @@ QWidget::changeEvent(e); } +void PropertyWidget_Orphans::iconSetChange() +{ + IconManager &im = IconManager::instance(); + + keepLabelStart->setPixmap(im.loadPixmap("paragraph-orphan")); + keepLabelEnd->setPixmap(im.loadPixmap("paragraph-widow")); +} + void PropertyWidget_Orphans::languageChange() { retranslateUi(this); Index: scribus/ui/propertywidget_orphans.h =================================================================== --- scribus/ui/propertywidget_orphans.h (Revision 26312) +++ scribus/ui/propertywidget_orphans.h (Arbeitskopie) @@ -27,6 +27,7 @@ void changeEvent(QEvent *e) override; public slots: + void iconSetChange(); void languageChange(); void handleKeepLinesStart(); void handleKeepLinesEnd(); Index: scribus/ui/propertywidget_orphansbase.ui =================================================================== --- scribus/ui/propertywidget_orphansbase.ui (Revision 26312) +++ scribus/ui/propertywidget_orphansbase.ui (Arbeitskopie) @@ -6,70 +6,135 @@ <rect> <x>0</x> <y>0</y> - <width>258</width> - <height>113</height> + <width>254</width> + <height>107</height> </rect> </property> - <layout class="QGridLayout" name="gridLayout" columnstretch="0,1"> + <layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0"> <property name="leftMargin"> - <number>3</number> + <number>8</number> </property> <property name="topMargin"> - <number>3</number> + <number>8</number> </property> <property name="rightMargin"> - <number>3</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>3</number> + <number>8</number> </property> - <property name="spacing"> - <number>3</number> + <property name="horizontalSpacing"> + <number>16</number> </property> - <item row="0" column="0"> - <widget class="QLabel" name="keepLabelStart"> - <property name="toolTip"> - <string>Ensure that first lines of a paragraph won't end up separated from the rest (known as widow/orphan control)</string> + <property name="verticalSpacing"> + <number>4</number> + </property> + <item row="1" column="0"> + <widget class="FormWidget" name="keepLabelStart"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="text"> - <string>Don't separate first:</string> + <property name="label" stdset="0"> + <string/> </property> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="keepLinesStart"> + <property name="toolTip"> + <string>Ensure that first lines of a paragraph won't end up separated from the rest (known as widow/orphan control)</string> + </property> + <property name="suffix"> + <string> lines</string> + </property> + <property name="maximum"> + <double>10.000000000000000</double> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="0" column="1"> - <widget class="ScrSpinBox" name="keepLinesStart"> - <property name="toolTip"> - <string>Ensure that first lines of a paragraph won't end up separated from the rest (known as widow/orphan control)</string> + <item row="1" column="1"> + <widget class="FormWidget" name="keepLabelEnd"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="suffix"> - <string> lines</string> + <property name="label" stdset="0"> + <string/> </property> - <property name="maximum"> - <number>10</number> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="keepLinesEnd"> + <property name="toolTip"> + <string>Ensure that last lines of a paragraph won't end up separated from the rest (known as widow/orphan control)</string> + </property> + <property name="suffix"> + <string> lines</string> + </property> + <property name="maximum"> + <double>10.000000000000000</double> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="keepLabelEnd"> - <property name="text"> - <string>Don't separate last:</string> + <item row="1" column="2"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="ScrSpinBox" name="keepLinesEnd"> - <property name="toolTip"> - <string>Ensure that last lines of a paragraph won't end up separated from the rest (known as widow/orphan control)</string> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> </property> - <property name="suffix"> - <string> lines</string> - </property> - <property name="maximum"> - <number>10</number> - </property> - </widget> + </spacer> </item> - <item row="2" column="0" colspan="2"> + <item row="2" column="0" colspan="3"> <widget class="QCheckBox" name="keepTogether"> <property name="toolTip"> <string>If checked, ensures that the paragraph won't be split across multiple pages or columns</string> @@ -79,7 +144,7 @@ </property> </widget> </item> - <item row="3" column="0" colspan="2"> + <item row="3" column="0" colspan="3"> <widget class="QCheckBox" name="keepWithNext"> <property name="toolTip"> <string>If checked, automatically moves the paragraph to the next column or page if the next paragraph isn't on the same page or column</string> @@ -93,11 +158,23 @@ </widget> <customwidgets> <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + <customwidget> <class>ScrSpinBox</class> <extends>QDoubleSpinBox</extends> <header location="global">ui/scrspinbox.h</header> </customwidget> </customwidgets> + <tabstops> + <tabstop>keepLinesStart</tabstop> + <tabstop>keepLinesEnd</tabstop> + <tabstop>keepTogether</tabstop> + <tabstop>keepWithNext</tabstop> + </tabstops> <resources/> <connections/> </ui> Index: scribus/ui/propertywidget_paragraphstyle.ui =================================================================== --- scribus/ui/propertywidget_paragraphstyle.ui (nicht existent) +++ scribus/ui/propertywidget_paragraphstyle.ui (Arbeitskopie) @@ -0,0 +1,261 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>PropertyWidget_ParagraphStyle</class> + <widget class="QFrame" name="PropertyWidget_ParagraphStyle"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>240</width> + <height>84</height> + </rect> + </property> + <property name="windowTitle"> + <string>Frame</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>8</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> + <item> + <layout class="QGridLayout" name="gridLayout" columnstretch="0,1"> + <property name="horizontalSpacing"> + <number>4</number> + </property> + <property name="verticalSpacing"> + <number>8</number> + </property> + <item row="0" column="0"> + <widget class="FormWidget" name="labelParagraphStyle"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ParaStyleComboBox" name="paraStyleCombo"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Paragraph style of currently selected text or paragraph</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="paraStyleClear"> + <property name="toolTip"> + <string>Remove Direct Paragraph Formatting</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="paraStyleEdit"> + <property name="toolTip"> + <string>Edit current selected paragraph style</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Policy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>8</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QToolButton" name="paraStyleNew"> + <property name="toolTip"> + <string>Add new paragraph style</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="0"> + <widget class="FormWidget" name="labelCharacterStyle"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_13"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="CharStyleComboBox" name="charStyleCombo"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Character style of currently selected text or paragraph</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="charStyleClear"> + <property name="toolTip"> + <string>Remove Direct Character Formatting</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="charStyleEdit"> + <property name="toolTip"> + <string>Edit current selected character style</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Policy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>8</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QToolButton" name="charStyleNew"> + <property name="toolTip"> + <string>Add new character style</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="0" column="1"> + <spacer name="horizontalSpacer_8"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>CharStyleComboBox</class> + <extends>QComboBox</extends> + <header>ui/stylecombos.h</header> + </customwidget> + <customwidget> + <class>ParaStyleComboBox</class> + <extends>QComboBox</extends> + <header>ui/stylecombos.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> Index: scribus/ui/propertywidget_pareffect.cpp =================================================================== --- scribus/ui/propertywidget_pareffect.cpp (Revision 26312) +++ scribus/ui/propertywidget_pareffect.cpp (Arbeitskopie) @@ -25,8 +25,6 @@ { setupUi(this); - layout()->setAlignment(Qt::AlignTop); - languageChange(); dropCapLines->setValue(2); @@ -33,16 +31,24 @@ if (m_doc) peCharStyleCombo->updateStyleList(); fillBulletStrEditCombo(); - enableParEffect(false); - bulletCharTableButton->setIcon(IconManager::instance().loadIcon("22/insert-table.png")); + numStart->setMinimum(1); numStart->setMaximum(9999); numLevelSpin->setMinimum(1); numLevelSpin->setMaximum(3); + numPrefix->setMaxLength(5); + numPrefix->setMaximumWidth(QFontMetrics(numPrefix->font()).averageCharWidth() * 7); + numSuffix->setMaxLength(5); + numSuffix->setMaximumWidth(QFontMetrics(numSuffix->font()).averageCharWidth() * 7); dropCapLines->setMinimum(2); dropCapLines->setMaximum(99); + peCombo->setCurrentIndex(0); + setType(peCombo->currentData().toInt()); + iconSetChange(); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); } void PropertyWidget_ParEffect::setMainWindow(ScribusMainWindow* mw) @@ -110,6 +116,9 @@ { IconManager& iconManager = IconManager::instance(); bulletCharTableButton->setIcon(iconManager.loadIcon("22/insert-table.png")); + peCharStyleLabel->setPixmap(iconManager.loadPixmap("character-style")); + peOffsetLabel->setPixmap(iconManager.loadPixmap("paragraph-list-offset")); + peLabel->setPixmap(iconManager.loadPixmap("paragraph-effects-style")); } void PropertyWidget_ParEffect::unitChange() @@ -162,59 +171,21 @@ peCharStyleCombo->blockSignals(blocked); } -void PropertyWidget_ParEffect::enableDropCap(bool enable) +void PropertyWidget_ParEffect::setType(int id) { -// dropCapRadio_->setChecked(enable); - dropCapLines->setEnabled(enable); - if (enable) + if (id == -1) // No effect { - dropCapsGroup->show(); - enableBullet(false); - enableNum(false); + stackedWidget->setVisible(false); + peGroup->setVisible(false); + peCombo->setCurrentIndex(0); } else - dropCapsGroup->hide(); -} -void PropertyWidget_ParEffect::enableBullet(bool enable) -{ - bulletStrEdit->setVisible(enable); - bulletCharTableButton->setVisible(enable); - bullGroup->setVisible(enable); - if (enable) { - enableDropCap(false); - enableNum(false); + stackedWidget->setCurrentIndex(id); + stackedWidget->setVisible(true); + peGroup->setVisible(true); } } -void PropertyWidget_ParEffect::enableNum(bool enable) -{ - numComboBox->setVisible(enable); - numLevelSpin->setVisible(enable); - numStart->setVisible(enable); - numPrefix->setVisible(enable); - numSuffix->setVisible(enable); - numFormatCombo->setVisible(enable); - numGroup->setVisible(enable); - if (enable) - { - enableBullet(false); - enableDropCap(false); - } -} -void PropertyWidget_ParEffect::enableParEffect(bool enable) -{ - peOffset->setVisible(enable); - peCharStyleCombo->setVisible(enable); - peIndent->setVisible(enable); - peGroup->setVisible(enable); - if (!enable) - { - enableBullet(false); - enableDropCap(false); - enableNum(false); - peCombo->setCurrentIndex(0); - } -} void PropertyWidget_ParEffect::fillBulletStrEditCombo() { @@ -232,10 +203,10 @@ QSignalBlocker sb(peCombo); int currIndex = peCombo->currentIndex(); peCombo->clear(); - peCombo->addItem(tr("No Paragraph Effects")); - peCombo->addItem(tr("Drop Caps")); - peCombo->addItem(tr("Bulleted List")); - peCombo->addItem(tr("Numbered List")); + peCombo->addItem(tr("No Paragraph Effects"), -1); + peCombo->addItem(tr("Drop Caps"), 0); + peCombo->addItem(tr("Bulleted List"), 1); + peCombo->addItem(tr("Numbered List"), 2); peCombo->setCurrentIndex(currIndex); } @@ -245,7 +216,7 @@ if (peCombo->currentIndex() && !newPStyle.hasBullet() && !newPStyle.hasDropCap() && !newPStyle.hasNum()) { - enableParEffect(false); + setType(-1); return; } @@ -262,25 +233,23 @@ QSignalBlocker blockerB(peIndent); QSignalBlocker blockerC(peCharStyleCombo); - bool enablePE = true; if (newPStyle.hasDropCap()) { peCombo->setCurrentIndex(1); - enableDropCap(true); } else if (newPStyle.hasBullet()) { peCombo->setCurrentIndex(2); - enableBullet(true); } else if (newPStyle.hasNum()) { peCombo->setCurrentIndex(3); - enableNum(true); } else - enablePE = false; + peCombo->setCurrentIndex(0); + setType(peCombo->currentData().toInt()); + QString numName = numComboBox->currentText(); dropCapLines->setValue(newPStyle.dropCapLines()); bulletStrEdit->setEditText(newPStyle.bulletStr()); @@ -303,8 +272,6 @@ peIndent->setChecked(newPStyle.parEffectIndent()); showCharStyle(newPStyle.peCharStyleName()); - enableParEffect(enablePE); - if (oldPeComboIndex != peCombo->currentIndex()) emit needsRelayout(); } @@ -349,7 +316,7 @@ PageItem_TextFrame *textItem = m_item->asTextFrame(); if (m_doc->appMode == modeEditTable) textItem = m_item->asTable()->activeCell().textFrame(); - if (textItem || m_item->isPathText()) + if (textItem)// || m_item->isPathText()) enabled = true; } setEnabled(enabled); @@ -389,10 +356,9 @@ return; ParagraphStyle newStyle; - enableParEffect(peCombo->currentIndex() != 0); + if (peCombo->currentIndex() == 1) { - enableDropCap(true); newStyle.setDropCapLines(dropCapLines->value()); newStyle.setHasDropCap(true); newStyle.setHasBullet(false); @@ -400,7 +366,6 @@ } else if (peCombo->currentIndex() == 2) { - enableBullet(true); newStyle.setHasBullet(true); QString bStr = bulletStrEdit->currentText(); if (bStr.isEmpty()) @@ -411,7 +376,6 @@ } else if (peCombo->currentIndex() == 3) { - enableNum(true); newStyle.setHasDropCap(false); newStyle.setHasBullet(false); newStyle.setHasNum(true); @@ -435,6 +399,9 @@ } newStyle.setParEffectOffset(peOffset->value() / m_unitRatio); newStyle.setParEffectIndent(peIndent->isChecked()); + + setType(peCombo->currentData().toInt()); + handleChanges(m_item, newStyle); emit needsRelayout(); Index: scribus/ui/propertywidget_pareffect.h =================================================================== --- scribus/ui/propertywidget_pareffect.h (Revision 26312) +++ scribus/ui/propertywidget_pareffect.h (Arbeitskopie) @@ -3,7 +3,7 @@ #include <QVector> -#include "numeration.h" +//#include "numeration.h" #include "propertywidgetbase.h" #include "ui/charselectenhanced.h" #include "ui_propertywidget_pareffectbase.h" @@ -76,10 +76,7 @@ private: void openEnhanced(); void closeEnhanced(bool show = false); - void enableDropCap(bool); - void enableBullet(bool); - void enableNum(bool); - void enableParEffect(bool); + void setType(int id); void fillBulletStrEditCombo(); void fillPECombo(); Index: scribus/ui/propertywidget_pareffectbase.ui =================================================================== --- scribus/ui/propertywidget_pareffectbase.ui (Revision 26312) +++ scribus/ui/propertywidget_pareffectbase.ui (Arbeitskopie) @@ -6,428 +6,530 @@ <rect> <x>0</x> <y>0</y> - <width>354</width> - <height>390</height> + <width>295</width> + <height>274</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> <property name="spacing"> - <number>3</number> + <number>4</number> </property> <property name="leftMargin"> - <number>3</number> + <number>8</number> </property> <property name="topMargin"> - <number>3</number> + <number>8</number> </property> <property name="rightMargin"> - <number>3</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>3</number> + <number>8</number> </property> <item> - <widget class="QComboBox" name="peCombo"/> - </item> - <item> - <widget class="QGroupBox" name="dropCapsGroup"> - <property name="title"> - <string>Drop Caps</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>6</number> - </property> - <property name="topMargin"> - <number>6</number> - </property> - <property name="rightMargin"> - <number>6</number> - </property> - <property name="bottomMargin"> - <number>6</number> - </property> - <item> - <widget class="QLabel" name="dropCapLinesLabel"> - <property name="toolTip"> - <string>Number of lines used by the drop cap</string> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <item> + <widget class="FormWidget" name="peLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <property name="leftMargin"> + <number>0</number> </property> - <property name="text"> - <string>Lines:</string> + <property name="topMargin"> + <number>0</number> </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="dropCapLines"> - <property name="minimum"> - <number>2</number> + <property name="rightMargin"> + <number>0</number> </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <property name="bottomMargin"> + <number>0</number> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> + <item> + <widget class="QComboBox" name="peCombo"/> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> </item> <item> - <widget class="QGroupBox" name="bullGroup"> - <property name="title"> - <string>Bulleted List</string> + <widget class="StackedContainer" name="stackedWidget"> + <property name="currentIndex"> + <number>2</number> </property> - <layout class="QGridLayout" name="gridLayout_3"> - <property name="leftMargin"> - <number>6</number> - </property> - <property name="topMargin"> - <number>6</number> - </property> - <property name="rightMargin"> - <number>6</number> - </property> - <property name="bottomMargin"> - <number>6</number> - </property> - <property name="spacing"> - <number>3</number> - </property> - <item row="0" column="1"> - <widget class="QComboBox" name="bulletStrEdit"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <property name="editable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="bulletCharLabel"> - <property name="text"> - <string>Bullet Char(s):</string> - </property> - <property name="buddy"> - <cstring>bulletStrEdit</cstring> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QPushButton" name="bulletCharTableButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Enhanced Character Table to choose bullet characters</string> - </property> - <property name="text"> - <string>Char Table</string> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> + <widget class="QWidget" name="pageDropCaps"> + <layout class="QGridLayout" name="gridLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>4</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>4</number> + </property> + <property name="horizontalSpacing"> + <number>4</number> + </property> + <property name="verticalSpacing"> + <number>8</number> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="dropCapLinesLabel"> + <property name="toolTip"> + <string>Number of lines used by the drop cap</string> + </property> + <property name="text"> + <string>Lines:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QSpinBox" name="dropCapLines"> + <property name="toolTip"> + <string>Drop Cap Lines</string> + </property> + <property name="minimum"> + <number>2</number> + </property> + </widget> + </item> + <item row="0" column="2"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="pageBulletedList"> + <layout class="QGridLayout" name="gridLayout_6" columnstretch="0,0,0,1"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>4</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>4</number> + </property> + <property name="horizontalSpacing"> + <number>4</number> + </property> + <property name="verticalSpacing"> + <number>8</number> + </property> + <item row="0" column="2"> + <widget class="QPushButton" name="bulletCharTableButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Enhanced Character Table to choose bullet characters</string> + </property> + <property name="text"> + <string>Char Table</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="bulletCharLabel"> + <property name="text"> + <string>Bullet Char(s):</string> + </property> + <property name="buddy"> + <cstring>bulletStrEdit</cstring> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="bulletStrEdit"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="editable"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="3"> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="pageNumberedList"> + <layout class="QGridLayout" name="gridLayout_5" columnstretch="0,0,0,0,0,0"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>4</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>4</number> + </property> + <property name="horizontalSpacing"> + <number>4</number> + </property> + <property name="verticalSpacing"> + <number>8</number> + </property> + <item row="2" column="5"> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="1"> + <widget class="QSpinBox" name="numLevelSpin"> + <property name="minimum"> + <number>1</number> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="numComboLabel"> + <property name="text"> + <string>Set:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="2" column="3"> + <widget class="QLabel" name="numStartLabel"> + <property name="text"> + <string>Start:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="numPrefixLabel"> + <property name="text"> + <string>Prefix:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + <property name="buddy"> + <cstring>numPrefix</cstring> + </property> + </widget> + </item> + <item row="3" column="3"> + <widget class="QLabel" name="numSuffixLabel"> + <property name="text"> + <string>Suffix:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + <property name="buddy"> + <cstring>numSuffix</cstring> + </property> + </widget> + </item> + <item row="2" column="2"> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Policy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>16</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="numFormatLabel"> + <property name="text"> + <string>Style:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + <property name="buddy"> + <cstring>numFormatCombo</cstring> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="numLevelLabel"> + <property name="text"> + <string>Level:</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + <property name="buddy"> + <cstring>numLevelSpin</cstring> + </property> + </widget> + </item> + <item row="2" column="4"> + <widget class="QSpinBox" name="numStart"> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>999</number> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLineEdit" name="numPrefix"/> + </item> + <item row="3" column="4"> + <widget class="QLineEdit" name="numSuffix"/> + </item> + <item row="1" column="1" colspan="4"> + <widget class="NumFormatCombo" name="numFormatCombo"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item row="0" column="1" colspan="4"> + <widget class="QComboBox" name="numComboBox"> + <property name="currentIndex"> + <number>-1</number> + </property> + </widget> + </item> + </layout> + </widget> </widget> </item> <item> - <widget class="QGroupBox" name="numGroup"> - <property name="title"> - <string>Numbered List</string> - </property> - <layout class="QGridLayout" name="gridLayout_2"> + <widget class="QWidget" name="peGroup" native="true"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="spacing"> + <number>8</number> + </property> <property name="leftMargin"> - <number>6</number> + <number>0</number> </property> <property name="topMargin"> - <number>6</number> + <number>0</number> </property> <property name="rightMargin"> - <number>6</number> + <number>0</number> </property> <property name="bottomMargin"> - <number>6</number> + <number>0</number> </property> - <property name="spacing"> - <number>3</number> - </property> - <item row="3" column="0" colspan="2"> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_5"> <property name="spacing"> - <number>3</number> + <number>20</number> </property> <item> - <widget class="QLabel" name="numLevelLabel"> - <property name="text"> - <string>Level:</string> + <widget class="FormWidget" name="peOffsetLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="buddy"> - <cstring>numLevelSpin</cstring> + <property name="label" stdset="0"> + <string/> </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="peOffset"> + <property name="toolTip"> + <string>Paragraph Effects characters offset</string> + </property> + <property name="minimum"> + <double>-3000.000000000000000</double> + </property> + <property name="maximum"> + <double>3000.000000000000000</double> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="QSpinBox" name="numLevelSpin"> - <property name="minimum"> - <number>1</number> + <widget class="QCheckBox" name="peIndent"> + <property name="text"> + <string>Auto-Indent</string> </property> </widget> </item> <item> - <spacer name="horizontalSpacer_2"> + <spacer name="horizontalSpacer_5"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>0</width> <height>20</height> </size> </property> </spacer> </item> - <item> - <widget class="QLabel" name="numStartLabel"> - <property name="text"> - <string>Start:</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="numStart"> - <property name="minimum"> - <number>1</number> - </property> - <property name="maximum"> - <number>999</number> - </property> - </widget> - </item> </layout> </item> - <item row="0" column="0" colspan="2"> - <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> <property name="spacing"> - <number>3</number> + <number>4</number> </property> <item> - <widget class="QLabel" name="numComboLabel"> - <property name="text"> - <string>Set:</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="numComboBox"> - <property name="currentIndex"> - <number>-1</number> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="numFormatLabel"> - <property name="text"> - <string>Format:</string> - </property> - <property name="buddy"> - <cstring>numFormatCombo</cstring> - </property> - </widget> - </item> - <item> - <widget class="NumFormatCombo" name="numFormatCombo"> + <widget class="FormWidget" name="peCharStyleLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - </widget> - </item> - </layout> - </item> - <item row="4" column="0" colspan="2"> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <widget class="QLabel" name="numPrefixLabel"> - <property name="text"> - <string>Prefix:</string> + <property name="label" stdset="0"> + <string/> </property> - <property name="buddy"> - <cstring>numPrefix</cstring> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="CharStyleComboBox" name="peCharStyleCombo"> + <property name="toolTip"> + <string>Choose Character Style or leave blank to use default Paragraph Style</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="QLineEdit" name="numPrefix"/> - </item> - <item> - <spacer name="horizontalSpacer_4"> + <spacer name="horizontalSpacer_2"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>0</width> <height>20</height> </size> </property> </spacer> </item> - <item> - <widget class="QLabel" name="numSuffixLabel"> - <property name="text"> - <string>Suffix:</string> - </property> - <property name="buddy"> - <cstring>numSuffix</cstring> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="numSuffix"/> - </item> </layout> </item> </layout> </widget> </item> - <item> - <widget class="QGroupBox" name="peGroup"> - <property name="title"> - <string>Effect Parameters</string> - </property> - <layout class="QGridLayout" name="gridLayout_4"> - <property name="leftMargin"> - <number>6</number> - </property> - <property name="topMargin"> - <number>6</number> - </property> - <property name="rightMargin"> - <number>6</number> - </property> - <property name="bottomMargin"> - <number>6</number> - </property> - <property name="spacing"> - <number>3</number> - </property> - <item row="6" column="0"> - <widget class="QLabel" name="peCharStyleLabel"> - <property name="text"> - <string>Char Style:</string> - </property> - <property name="buddy"> - <cstring>peCharStyleCombo</cstring> - </property> - </widget> - </item> - <item row="6" column="1"> - <widget class="CharStyleComboBox" name="peCharStyleCombo"> - <property name="toolTip"> - <string>Choose Character Style or leave blank to use default Paragraph Style</string> - </property> - </widget> - </item> - <item row="1" column="0" colspan="2"> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <widget class="QCheckBox" name="peIndent"> - <property name="text"> - <string>Auto-Indent</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="peOffsetLabel"> - <property name="text"> - <string>Offset:</string> - </property> - <property name="buddy"> - <cstring>peOffset</cstring> - </property> - </widget> - </item> - <item> - <widget class="ScrSpinBox" name="peOffset"> - <property name="minimum"> - <double>-3000.000000000000000</double> - </property> - <property name="maximum"> - <double>3000.000000000000000</double> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </item> </layout> </widget> <customwidgets> <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + <customwidget> <class>ScrSpinBox</class> <extends>QDoubleSpinBox</extends> - <header>ui/scrspinbox.h</header> + <header location="global">ui/scrspinbox.h</header> </customwidget> <customwidget> <class>CharStyleComboBox</class> @@ -439,7 +541,28 @@ <extends>QComboBox</extends> <header>ui/numformatcombo.h</header> </customwidget> + <customwidget> + <class>StackedContainer</class> + <extends>QStackedWidget</extends> + <header>ui/widgets/stacked_container.h</header> + <container>1</container> + </customwidget> </customwidgets> + <tabstops> + <tabstop>peCombo</tabstop> + <tabstop>numComboBox</tabstop> + <tabstop>numFormatCombo</tabstop> + <tabstop>numLevelSpin</tabstop> + <tabstop>numStart</tabstop> + <tabstop>numPrefix</tabstop> + <tabstop>numSuffix</tabstop> + <tabstop>peOffset</tabstop> + <tabstop>peIndent</tabstop> + <tabstop>peCharStyleCombo</tabstop> + <tabstop>dropCapLines</tabstop> + <tabstop>bulletStrEdit</tabstop> + <tabstop>bulletCharTableButton</tabstop> + </tabstops> <resources/> <connections/> </ui> Index: scribus/ui/propertywidget_pathtext.cpp =================================================================== --- scribus/ui/propertywidget_pathtext.cpp (Revision 26312) +++ scribus/ui/propertywidget_pathtext.cpp (Arbeitskopie) @@ -9,6 +9,7 @@ #include <QSignalBlocker> +#include "iconmanager.h" #include "localemgr.h" #include "scribus.h" #include "scribusapp.h" @@ -27,9 +28,12 @@ distFromCurve->setValues(-300, 300, 2, 0); distFromCurve->setSingleStep(10); + languageChange(); + iconSetChange(); + connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); - - languageChange(); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void PropertyWidget_PathText::setMainWindow(ScribusMainWindow* mw) @@ -118,7 +122,7 @@ { connect(showCurveCheckBox, SIGNAL(clicked()) , this, SLOT(handlePathLine())); connect(pathTextType , SIGNAL(activated(int)), this, SLOT(handlePathType())); - connect(flippedPathText , SIGNAL(clicked()) , this, SLOT(handlePathFlip())); + connect(flippedPathText , SIGNAL(toggled(bool)) , this, SLOT(handlePathFlip())); connect(startOffset , SIGNAL(valueChanged(double)), this, SLOT(handlePathDist())); connect(distFromCurve , SIGNAL(valueChanged(double)), this, SLOT(handlePathOffs())); } @@ -127,7 +131,7 @@ { disconnect(showCurveCheckBox, SIGNAL(clicked()) , this, SLOT(handlePathLine())); disconnect(pathTextType , SIGNAL(activated(int)), this, SLOT(handlePathType())); - disconnect(flippedPathText , SIGNAL(clicked()) , this, SLOT(handlePathFlip())); + disconnect(flippedPathText , SIGNAL(toggled(bool)) , this, SLOT(handlePathFlip())); disconnect(startOffset , SIGNAL(valueChanged(double)), this, SLOT(handlePathDist())); disconnect(distFromCurve , SIGNAL(valueChanged(double)), this, SLOT(handlePathOffs())); } @@ -217,6 +221,16 @@ QWidget::changeEvent(e); } + +void PropertyWidget_PathText::iconSetChange() +{ + IconManager &im = IconManager::instance(); + + startOffsetLabel->setPixmap(im.loadPixmap("text-on-path-offset")); + distFromCurveLabel->setPixmap(im.loadPixmap("text-on-path-distance")); + flippedPathText->setIcon(im.loadIcon("text-on-path-flip")); +} + void PropertyWidget_PathText::languageChange() { QSignalBlocker pathTextTypeBlocker(pathTextType); @@ -227,11 +241,10 @@ pathTextType->addItem( tr("Skew")); pathTextType->setCurrentIndex(oldPathType); - flippedPathText->setText( tr("Flip Text")); showCurveCheckBox->setText( tr("Show Curve")); - pathTextTypeLabel->setText( tr("Type:")); - startOffsetLabel->setText( tr("Start Offset:")); - distFromCurveLabel->setText( tr("Distance from Curve:")); + pathTextTypeLabel->setText( tr("Type")); + startOffsetLabel->setText( tr("Start Offset")); + distFromCurveLabel->setText( tr("Distance")); QString ptSuffix = tr(" pt"); QString unitSuffix = m_doc ? unitGetSuffixFromIndex(m_doc->unitIndex()) : ptSuffix; @@ -260,3 +273,12 @@ startOffset->setLocale(l); distFromCurve->setLocale(l); } + +void PropertyWidget_PathText::toggleLabelVisibility(bool v) +{ + distFromCurveLabel->setLabelVisibility(v); + startOffsetLabel->setLabelVisibility(v); + pathTextTypeLabel->setLabelVisibility(v); + curveLabel->setLabelVisibility(v); + flipLabel->setLabelVisibility(v); +} Index: scribus/ui/propertywidget_pathtext.h =================================================================== --- scribus/ui/propertywidget_pathtext.h (Revision 26312) +++ scribus/ui/propertywidget_pathtext.h (Arbeitskopie) @@ -45,9 +45,11 @@ void handleSelectionChanged(); void handleUpdateRequest(int); + void iconSetChange(); void languageChange(); void unitChange(); void localeChange(); + void toggleLabelVisibility(bool v); private slots: void handlePathType(); Index: scribus/ui/propertywidget_pathtextbase.ui =================================================================== --- scribus/ui/propertywidget_pathtextbase.ui (Revision 26312) +++ scribus/ui/propertywidget_pathtextbase.ui (Arbeitskopie) @@ -6,77 +6,269 @@ <rect> <x>0</x> <y>0</y> - <width>243</width> - <height>143</height> + <width>296</width> + <height>124</height> </rect> </property> - <layout class="QGridLayout" name="gridLayout"> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>8</number> + </property> <property name="leftMargin"> - <number>3</number> + <number>8</number> </property> <property name="topMargin"> - <number>3</number> + <number>8</number> </property> <property name="rightMargin"> - <number>3</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>3</number> + <number>8</number> </property> - <property name="spacing"> - <number>3</number> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="pathTextTypeLabel"> - <property name="text"> - <string>Type:</string> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,1"> + <property name="spacing"> + <number>16</number> </property> - </widget> + <item> + <widget class="FormWidget" name="pathTextTypeLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Type</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QComboBox" name="pathTextType"/> + </item> + </layout> + </widget> + </item> + <item> + <widget class="FormWidget" name="flipLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Flip</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QToolButton" name="flippedPathText"> + <property name="text"> + <string/> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </item> + <item> + <widget class="FormWidget" name="curveLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <property name="preserveLabelSpace"> + <bool>true</bool> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QCheckBox" name="showCurveCheckBox"> + <property name="text"> + <string>Show Curve</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> </item> - <item row="0" column="1"> - <widget class="QComboBox" name="pathTextType"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="startOffsetLabel"> - <property name="text"> - <string>Start Offset:</string> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="spacing"> + <number>16</number> </property> - </widget> + <item> + <widget class="FormWidget" name="startOffsetLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Offset</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="startOffset"/> + </item> + </layout> + </widget> + </item> + <item> + <widget class="FormWidget" name="distFromCurveLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Distance</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="distFromCurve"/> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> </item> - <item row="1" column="1"> - <widget class="ScrSpinBox" name="startOffset"/> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="distFromCurveLabel"> - <property name="text"> - <string>Distance from Curve:</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="ScrSpinBox" name="distFromCurve"/> - </item> - <item row="3" column="0"> - <widget class="QCheckBox" name="flippedPathText"> - <property name="text"> - <string>Flip Text</string> - </property> - </widget> - </item> - <item row="4" column="0"> - <widget class="QCheckBox" name="showCurveCheckBox"> - <property name="text"> - <string>Show Curve</string> - </property> - </widget> - </item> </layout> </widget> <customwidgets> <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + <customwidget> <class>ScrSpinBox</class> <extends>QDoubleSpinBox</extends> - <header>ui/scrspinbox.h</header> + <header location="global">ui/scrspinbox.h</header> </customwidget> </customwidgets> <resources/> Index: scribus/ui/propertywidget_text.cpp =================================================================== --- scribus/ui/propertywidget_text.cpp (Revision 26312) +++ scribus/ui/propertywidget_text.cpp (Arbeitskopie) @@ -5,7 +5,6 @@ for which a new license (GPL+exception) is in place. */ #include "propertywidget_text.h" -#include "ui_propertywidget_textbase.h" #include "appmodes.h" #include "commonstrings.h" @@ -20,9 +19,7 @@ #include "selection.h" #include "stylecombos.h" #include "undomanager.h" -#include "langmgr.h" - PropertyWidget_Text::PropertyWidget_Text( QWidget* parent) : QFrame(parent) { setupUi(this); @@ -29,23 +26,31 @@ fontSize->setPrefix(""); + buttonTextColor->setContext(Context::Text); + buttonTextColor->setMenuContextType(ColorButton::Floating); + buttonTextColor->setColor( CommonStrings::tr_NoneColor); + buttonTextColor->setIconSize(QSize(20, 20)); + buttonTextColor->setApplyColorOnIcon(true); + + buttonBackgroundColor->setContext(Context::TextBackground); + buttonBackgroundColor->setMenuContextType(ColorButton::Floating); + buttonBackgroundColor->setColor(CommonStrings::tr_NoneColor); +// buttonBackgroundColor->setIconSize(QSize(16, 16)); + + labelFontSize->setLabelVisibility(false); + labelLineSpacing->setLabelVisibility(false); + labelLineHeight->setLabelVisibility(false); + fonts->toggleLabelVisibility(false); + + fonts->setGuestWidget(labelFontSize); + iconSetChange(); languageChange(); - connect(lineSpacing , SIGNAL(valueChanged(double)), this, SLOT(handleLineSpacing())); - connect(fonts , SIGNAL(fontSelected(QString)), this, SLOT(handleTextFont(QString))); - connect(fontSize , SIGNAL(valueChanged(double)), this, SLOT(handleFontSize())); - connect(textAlignment , SIGNAL(State(int)) , this, SLOT(handleAlignment(int))); - connect(textDirection , SIGNAL(State(int)) , this, SLOT(handleDirection(int))); - connect(charStyleClear, SIGNAL(clicked()), this, SLOT(doClearCStyle())); - connect(paraStyleClear, SIGNAL(clicked()), this, SLOT(doClearPStyle())); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); - connect(lineSpacingModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(handleLineSpacingMode(int))); - connect(langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeLang(int))); - -// connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); -// connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); - setEnabled(false); } @@ -53,10 +58,7 @@ { m_ScMW = mw; -// connect(m_ScMW, SIGNAL(UpdateRequest(int)) , this , SLOT(handleUpdateRequest(int))); - - connect(paraStyleCombo, SIGNAL(newStyle(QString)), m_ScMW, SLOT(setNewParStyle(QString)), Qt::UniqueConnection); - connect(charStyleCombo, SIGNAL(newStyle(QString)), m_ScMW, SLOT(setNewCharStyle(QString)), Qt::UniqueConnection); + connect(m_ScMW, SIGNAL(UpdateRequest(int)) , this , SLOT(handleUpdateRequest(int))); } void PropertyWidget_Text::setDoc(ScribusDoc *d) @@ -79,11 +81,12 @@ lineSpacing->setValues(1, 2048, 2, 1); fonts->rebuildList(m_doc); - paraStyleCombo->setDoc(m_doc); - charStyleCombo->setDoc(m_doc); + buttonTextColor->setDoc(m_doc); + buttonBackgroundColor->setDoc(m_doc); if (m_doc.isNull()) { + disconnectSignals(); return; } @@ -101,6 +104,7 @@ currentItem = m_doc->m_Selection->itemAt(0); else if (m_doc->m_Selection->count() == 1) currentItem = m_doc->m_Selection->itemAt(0); + if (currentItem && currentItem->isTable() && m_doc->appMode == modeEditTable) currentItem = currentItem->asTable()->activeCell().textFrame(); } @@ -108,6 +112,26 @@ return currentItem; } +void PropertyWidget_Text::connectSignals() +{ + connect(lineSpacing , SIGNAL(valueChanged(double)), this, SLOT(handleLineSpacing())); + connect(fonts , SIGNAL(fontSelected(QString)), this, SLOT(handleTextFont(QString))); + connect(fontSize , SIGNAL(valueChanged(double)), this, SLOT(handleFontSize())); + connect(lineSpacingModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(handleLineSpacingMode(int))); + connect(buttonTextColor , SIGNAL(changed()), this, SLOT(handleTextFill())); + connect(buttonBackgroundColor , SIGNAL(changed()), this, SLOT(handleTextBackground())); +} + +void PropertyWidget_Text::disconnectSignals() +{ + disconnect(lineSpacing , SIGNAL(valueChanged(double)), this, SLOT(handleLineSpacing())); + disconnect(fonts , SIGNAL(fontSelected(QString)), this, SLOT(handleTextFont(QString))); + disconnect(fontSize , SIGNAL(valueChanged(double)), this, SLOT(handleFontSize())); + disconnect(lineSpacingModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(handleLineSpacingMode(int))); + disconnect(buttonTextColor , SIGNAL(changed()), this, SLOT(handleTextFill())); + disconnect(buttonBackgroundColor , SIGNAL(changed()), this, SLOT(handleTextBackground())); +} + void PropertyWidget_Text::handleSelectionChanged() { if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning()) @@ -151,24 +175,11 @@ void PropertyWidget_Text::handleUpdateRequest(int updateFlags) { - // ColorWidget will handle its update itself - /*if (updateFlags & reqColorsUpdate) - updateColorList();*/ - if (updateFlags & reqCharStylesUpdate) - { - charStyleCombo->updateStyleList(); - } - if (updateFlags & reqParaStylesUpdate) - paraStyleCombo->updateStyleList(); if (updateFlags & reqDefFontListUpdate) fonts->rebuildList(nullptr); + if (updateFlags & reqDocFontListUpdate) fonts->rebuildList(m_haveDoc ? m_doc : nullptr); - if (updateFlags & reqStyleComboDocUpdate) - { - paraStyleCombo->setDoc(m_haveDoc ? m_doc : nullptr); - charStyleCombo->setDoc(m_haveDoc ? m_doc : nullptr); - } } void PropertyWidget_Text::setCurrentItem(PageItem *item) @@ -182,11 +193,14 @@ //if (m_item == i) // return; + disconnectSignals(); + if (!m_doc) setDoc(item->doc()); m_haveItem = false; m_item = item; + m_haveItem = true; if ((m_item->isGroup()) && (!m_item->isSingleSel)) { @@ -193,15 +207,15 @@ setEnabled(false); } - m_haveItem = true; - - if (m_item->isTextFrame() || m_item->isPathText() || m_item->isTable()) { ParagraphStyle parStyle = m_item->itemText.defaultStyle(); if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable) m_item->currentTextProps(parStyle); + updateStyle(parStyle); + setEnabled(true); + } if (m_item->isOSGFrame()) { @@ -211,21 +225,25 @@ { setEnabled(false); } + + connectSignals(); } void PropertyWidget_Text::iconSetChange() { - IconManager& iconManager = IconManager::instance(); + IconManager& im = IconManager::instance(); - fontSizeLabel->setPixmap(iconManager.loadPixmap("zeichen.png")); - lineSpacingLabel->setPixmap(iconManager.loadPixmap("linespacing2.png")); - textAlignmentLabel->setPixmap(iconManager.loadPixmap("22/text-align.png")); - langLabel->setPixmap(iconManager.loadPixmap("22/language.png")); - paraStyleLabel->setPixmap(iconManager.loadPixmap("22/paragraph-style.png")); - charStyleLabel->setPixmap(iconManager.loadPixmap("22/character-style.png")); + labelFontSize->setPixmap(im.loadPixmap("font-size")); + labelLineSpacing->setPixmap(im.loadPixmap("paragraph-line-height")); + buttonTextColor->setIcon(im.loadIcon("text-color", buttonTextColor->iconSize())); +// buttonBackgroundColor->setIcon(im.loadIcon("text-background-color", buttonBackgroundColor->iconSize().width())); +} - paraStyleClear->setIcon(iconManager.loadPixmap("16/edit-clear.png")); - charStyleClear->setIcon(iconManager.loadPixmap("16/edit-clear.png")); + +void PropertyWidget_Text::toggleLabelVisibility(bool v) +{ + labelTextColor->setLabelVisibility(v); + labelBackgroundColor->setLabelVisibility(v); } @@ -245,33 +263,30 @@ m_doc->itemSelection_SetLineSpacingMode(id, &tempSelection); updateStyle(((m_doc->appMode == modeEdit) || (m_doc->appMode == modeEditTable)) ? m_item->currentStyle() : m_item->itemText.defaultStyle()); m_doc->regionsChanged()->update(QRect()); + } -void PropertyWidget_Text::changeLang(int id) +void PropertyWidget_Text::showLineSpacing(const ParagraphStyle& newCurrent) { - if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) + if (!m_ScMW || !m_item || m_ScMW->scriptIsRunning()) return; - QStringList languageList; - LanguageManager::instance()->fillInstalledStringList(&languageList); - QString abrv = LanguageManager::instance()->getAbbrevFromLang(languageList.value(id),false); - Selection tempSelection(this, false); - tempSelection.addItem(m_item, true); - m_doc->itemSelection_SetLanguage(abrv, &tempSelection); -} -void PropertyWidget_Text::showLineSpacing(double r) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - bool inEditMode = (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable); bool tmp = m_haveItem; + double r = newCurrent.lineSpacing(); m_haveItem = false; - lineSpacing->showValue(r); - const ParagraphStyle& curStyle(m_haveItem && inEditMode ? m_item->currentStyle() : m_item->itemText.defaultStyle()); + if (tmp) { - setupLineSpacingSpinbox(curStyle.lineSpacingMode(), r); - lineSpacingModeCombo->setCurrentIndex(curStyle.lineSpacingMode()); + if (newCurrent.lineSpacingMode() == ParagraphStyle::AutomaticLineSpacing) + { + double autoLS = static_cast<double>(m_item->doc()->typographicPrefs().autoLineSpacing) / 100.0; + r = newCurrent.charStyle().font().height(newCurrent.charStyle().fontSize() / 10.0) * autoLS; + } + else if (newCurrent.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing) + r = m_item->doc()->guidesPrefs().valueBaselineGrid; + + setupLineSpacingSpinbox(newCurrent.lineSpacingMode(), r); + lineSpacingModeCombo->setCurrentIndex(newCurrent.lineSpacingMode()); } m_haveItem = tmp; } @@ -295,39 +310,11 @@ fontSize->showValue(s / 10.0); } -void PropertyWidget_Text::showLanguage(const QString& w) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - QStringList lang; - LanguageManager::instance()->fillInstalledStringList(&lang); - QString langName = LanguageManager::instance()->getLangFromAbbrev(w, true); - - bool sigBlocked = langCombo->blockSignals(true); - langCombo->setCurrentIndex(lang.indexOf(langName)); - langCombo->blockSignals(sigBlocked); -} - void PropertyWidget_Text::setupLineSpacingSpinbox(int mode, double value) { bool blocked = lineSpacing->blockSignals(true); - if (mode > 0) - { - if (mode == 1) - lineSpacing->setSpecialValueText( tr( "Auto" ) ); - if (mode == 2) - lineSpacing->setSpecialValueText( tr( "Baseline" ) ); - lineSpacing->setMinimum(0); - lineSpacing->setValue(0); - lineSpacing->setEnabled(false); - } - else - { - lineSpacing->setSpecialValueText(""); - lineSpacing->setMinimum(1); - lineSpacing->setValue(value); - lineSpacing->setEnabled(true); - } + lineSpacing->setValue(value); + lineSpacing->setEnabled((mode == 0)); lineSpacing->blockSignals(blocked); } @@ -338,7 +325,8 @@ showFontFace(charStyle.font().scName()); showFontSize(charStyle.fontSize()); - showLanguage(charStyle.language()); + showTextColors(charStyle.fillColor(), charStyle.backColor(), charStyle.fillShade(), charStyle.backShade()); + } void PropertyWidget_Text::updateStyle(const ParagraphStyle& newCurrent) @@ -350,104 +338,11 @@ showFontFace(charStyle.font().scName()); showFontSize(charStyle.fontSize()); - showLanguage(charStyle.language()); + showTextColors(charStyle.fillColor(), charStyle.backColor(), charStyle.fillShade(), charStyle.backShade()); + showLineSpacing(newCurrent); - if (m_item) - { - QString defaultParStyle = m_item->itemText.defaultStyle().parent(); - if (defaultParStyle.isEmpty()) - defaultParStyle = CommonStrings::DefaultParagraphStyle; - paraStyleCombo->setDefaultStyle(defaultParStyle); - } - showParStyle(newCurrent.parent()); - - if (m_item) - { - QString defaultCharStyle; - if (!newCurrent.parent().isEmpty()) - { - const ParagraphStyle* paraStyle = m_doc->paragraphStyles().getPointer(newCurrent.parent()); - if (paraStyle) - defaultCharStyle = paraStyle->charStyle().parent(); - if (defaultCharStyle.isEmpty()) - defaultCharStyle = CommonStrings::DefaultCharacterStyle; - } - if (defaultCharStyle.isEmpty()) - defaultCharStyle = m_item->itemText.defaultStyle().charStyle().parent(); - if (defaultCharStyle.isEmpty()) - defaultCharStyle = CommonStrings::DefaultCharacterStyle; - charStyleCombo->setDefaultStyle(defaultCharStyle); - } - showCharStyle(charStyle.parent()); - - bool tmp = m_haveItem; - m_haveItem = false; - - setupLineSpacingSpinbox(newCurrent.lineSpacingMode(), newCurrent.lineSpacing()); - lineSpacingModeCombo->setCurrentIndex(newCurrent.lineSpacingMode()); - textAlignment->setStyle(newCurrent.alignment(), newCurrent.direction()); - textDirection->setStyle(newCurrent.direction()); - - m_haveItem = tmp; } -void PropertyWidget_Text::updateCharStyles() -{ - charStyleCombo->updateStyleList(); -} - -void PropertyWidget_Text::updateParagraphStyles() -{ - paraStyleCombo->updateStyleList(); - charStyleCombo->updateStyleList(); -} - -void PropertyWidget_Text::updateTextStyles() -{ - paraStyleCombo->updateStyleList(); - charStyleCombo->updateStyleList(); -} - -void PropertyWidget_Text::showAlignment(int e) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - bool tmp = m_haveItem; - m_haveItem = false; - textAlignment->setEnabled(true); - textAlignment->setStyle(e, textDirection->getStyle()); - m_haveItem = tmp; -} - -void PropertyWidget_Text::showDirection(int e) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - bool tmp = m_haveItem; - m_haveItem = false; - textDirection->setEnabled(true); - textDirection->setStyle(e); - m_haveItem = tmp; -} - -void PropertyWidget_Text::showCharStyle(const QString& name) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - bool blocked = charStyleCombo->blockSignals(true); - charStyleCombo->setStyle(name); - charStyleCombo->blockSignals(blocked); -} - -void PropertyWidget_Text::showParStyle(const QString& name) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - bool blocked = paraStyleCombo->blockSignals(true); - paraStyleCombo->setStyle(name); - paraStyleCombo->blockSignals(blocked); -} - void PropertyWidget_Text::handleLineSpacing() { if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) @@ -466,109 +361,92 @@ m_doc->itemSelection_SetFontSize(qRound(fontSize->value()*10.0), &tempSelection); } -void PropertyWidget_Text::handleAlignment(int a) +void PropertyWidget_Text::handleTextFont(const QString& font) { if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) return; Selection tempSelection(this, false); tempSelection.addItem(m_item, true); - m_doc->itemSelection_SetAlignment(a, &tempSelection); - - emit alignmentHandled(); - -// if (m_item->isPathText()) -// pathTextWidgets->handleSelectionChanged(); + m_doc->itemSelection_SetFont(font, &tempSelection); } -void PropertyWidget_Text::handleDirection(int d) +void PropertyWidget_Text::changeEvent(QEvent *e) { - if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) + if (e->type() == QEvent::LanguageChange) + { + languageChange(); return; - Selection tempSelection(this, false); - tempSelection.addItem(m_item, true); - m_doc->itemSelection_SetDirection(d, &tempSelection); - // If current text alignment is left or right, change it to match direction - if (d == ParagraphStyle::RTL && textAlignment->selectedId() == ParagraphStyle::LeftAligned) - { - m_doc->itemSelection_SetAlignment(ParagraphStyle::RightAligned, &tempSelection); - textAlignment->setTypeStyle(ParagraphStyle::RightAligned); } - else if (d == ParagraphStyle::LTR && textAlignment->selectedId() == ParagraphStyle::RightAligned) - { - m_doc->itemSelection_SetAlignment(ParagraphStyle::LeftAligned, &tempSelection); - textAlignment->setTypeStyle(ParagraphStyle::LeftAligned); - } + QWidget::changeEvent(e); } -void PropertyWidget_Text::handleTextFont(const QString& font) +void PropertyWidget_Text::languageChange() { - if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - Selection tempSelection(this, false); - tempSelection.addItem(m_item, true); - m_doc->itemSelection_SetFont(font, &tempSelection); -} + retranslateUi(this); -void PropertyWidget_Text::doClearCStyle() -{ - if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveDoc || !m_haveItem) - return; - Selection tempSelection(this, false); - tempSelection.addItem(m_item, true); - m_doc->itemSelection_EraseCharStyle(&tempSelection); + QSignalBlocker lineSpacingModeBlocker(lineSpacingModeCombo); + int oldLineSpacingMode = lineSpacingModeCombo->currentIndex(); + lineSpacingModeCombo->clear(); + lineSpacingModeCombo->addItem( tr("Fixed")); + lineSpacingModeCombo->addItem( tr("Automatic")); + lineSpacingModeCombo->addItem( tr("Baseline")); + lineSpacingModeCombo->setCurrentIndex(oldLineSpacingMode); + + buttonTextColor->setPersistentToolTip( tr("Color of selected text")); + buttonBackgroundColor->setPersistentToolTip( tr("Background color of selected text")); } - -void PropertyWidget_Text::doClearPStyle() +void PropertyWidget_Text::handleTextFill() { - if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveDoc || !m_haveItem) + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) return; - UndoTransaction activeTransaction; - if (UndoManager::undoEnabled()) - activeTransaction = UndoManager::instance()->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::RemoveTextStyle, tr( "remove direct paragraph formatting" ), Um::IFont); + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_blockUpdate = true; + m_doc->itemSelection_SetFillColor(buttonTextColor->colorName(), &tempSelection); + m_doc->itemSelection_SetFillShade(buttonTextColor->colorData().Shade, &tempSelection); + m_blockUpdate = false; - Selection tempSelection(this, false); - tempSelection.addItem(m_item, true); - m_doc->itemSelection_ClearBulNumStrings(&tempSelection); - m_doc->itemSelection_EraseParagraphStyle(&tempSelection); - CharStyle emptyCStyle; - m_doc->itemSelection_SetCharStyle(emptyCStyle, &tempSelection); - - if (activeTransaction) - activeTransaction.commit(); + } } -void PropertyWidget_Text::changeEvent(QEvent *e) +void PropertyWidget_Text::handleTextBackground() { - if (e->type() == QEvent::LanguageChange) + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) { - languageChange(); - return; + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_blockUpdate = true; + m_doc->itemSelection_SetBackgroundColor(buttonBackgroundColor->colorName(), &tempSelection); + m_doc->itemSelection_SetBackgroundShade(buttonBackgroundColor->colorData().Shade, &tempSelection); + m_blockUpdate = false; } - QWidget::changeEvent(e); } -void PropertyWidget_Text::languageChange() +void PropertyWidget_Text::showTextColors(const QString& fillCol, const QString& backCol, double fillShd, double backShd) { - retranslateUi(this); - QSignalBlocker lineSpacingModeBlocker(lineSpacingModeCombo); - int oldLineSpacingMode = lineSpacingModeCombo->currentIndex(); - lineSpacingModeCombo->clear(); - lineSpacingModeCombo->addItem( tr("Fixed Linespacing")); - lineSpacingModeCombo->addItem( tr("Automatic Linespacing")); - lineSpacingModeCombo->addItem( tr("Align to Baseline Grid")); - lineSpacingModeCombo->setCurrentIndex(oldLineSpacingMode); + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning() || m_blockUpdate) + return; - QSignalBlocker langComboBlocker(langCombo); - QStringList languageList; - LanguageManager::instance()->fillInstalledStringList(&languageList); - int oldLang = langCombo->currentIndex(); - langCombo->clear(); - langCombo->addItems(languageList); - langCombo->setCurrentIndex(oldLang); + buttonTextColor->setColor(fillCol, qRound(fillShd)); + buttonTextColor->updatePreview(); + buttonTextColor->updateFloatingContext(); - textAlignment->languageChange(); - textDirection->languageChange(); + buttonBackgroundColor->setColor(backCol, qRound(backShd)); + buttonBackgroundColor->updatePreview(); + buttonBackgroundColor->updateFloatingContext(); + } Index: scribus/ui/propertywidget_text.h =================================================================== --- scribus/ui/propertywidget_text.h (Revision 26312) +++ scribus/ui/propertywidget_text.h (Arbeitskopie) @@ -5,10 +5,6 @@ #include "propertywidgetbase.h" #include <QFrame> -//namespace Ui { -//class PropertyWidget_Text; -//} - class CharStyle; class ParagraphStyle; class ScribusDoc; @@ -37,6 +33,7 @@ bool m_haveDoc {false}; bool m_haveItem {false}; + bool m_blockUpdate {false}; PageItem* m_item { nullptr }; ScribusMainWindow* m_ScMW { nullptr }; @@ -49,17 +46,13 @@ void iconSetChange(); void languageChange(); void localeChange(); - void changeLang(int id); void unitChange() {}; + void toggleLabelVisibility(bool v); - void showAlignment(int e); - void showDirection(int e); - void showCharStyle(const QString& name); void showFontFace(const QString&); void showFontSize(double s); - void showLanguage(const QString& w); - void showLineSpacing(double r); - void showParStyle(const QString& name); + void showLineSpacing(const ParagraphStyle &newCurrent); + void showTextColors(const QString& fillCol, const QString& backCol, double fillShd, double backShd); void setupLineSpacingSpinbox(int mode, double value); @@ -66,24 +59,17 @@ void updateCharStyle(const CharStyle& charStyle); void updateStyle(const ParagraphStyle& newCurrent); - void updateCharStyles(); - void updateParagraphStyles(); - void updateTextStyles(); - void handleLineSpacingMode(int id); void handleTextFont(const QString&); + private slots: - void handleAlignment(int a); - void handleDirection(int d); + void handleFontSize(); void handleLineSpacing(); + void handleTextFill(); + void handleTextBackground(); - void doClearCStyle(); - void doClearPStyle(); - -signals: - void alignmentHandled(); }; #endif // PROPERTYWIDGET_TEXT_H Index: scribus/ui/propertywidget_textbase.ui =================================================================== --- scribus/ui/propertywidget_textbase.ui (Revision 26312) +++ scribus/ui/propertywidget_textbase.ui (Arbeitskopie) @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>281</width> - <height>241</height> + <width>219</width> + <height>176</height> </rect> </property> <property name="windowTitle"> @@ -15,162 +15,180 @@ </property> <layout class="QVBoxLayout" name="verticalLayout"> <property name="spacing"> - <number>4</number> + <number>8</number> </property> <property name="leftMargin"> - <number>3</number> + <number>8</number> </property> <property name="topMargin"> - <number>3</number> + <number>8</number> </property> <property name="rightMargin"> - <number>3</number> + <number>8</number> </property> <property name="bottomMargin"> - <number>3</number> + <number>8</number> </property> <item> - <widget class="FontComboH" name="fonts" native="true"/> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> + <layout class="QHBoxLayout" name="horizontalLayout_7"> <property name="spacing"> - <number>3</number> + <number>4</number> </property> <item> - <widget class="QLabel" name="fontSizeLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> - </property> - </widget> + <widget class="FontComboH" name="fonts" native="true"/> </item> <item> - <widget class="ScrSpinBox" name="fontSize"> + <widget class="FormWidget" name="labelFontSize"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip"> + <property name="label" stdset="0"> <string>Font Size</string> </property> - <property name="suffix"> - <string> pt</string> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="fontSize"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Font Size</string> + </property> + <property name="suffix"> + <string> pt</string> + </property> + </widget> + </item> + </layout> </widget> </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="spacing"> - <number>3</number> - </property> <item> - <widget class="QLabel" name="lineSpacingLabel"> - <property name="minimumSize"> + <spacer name="horizontalSpacer_10"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> <size> - <width>20</width> + <width>0</width> <height>0</height> </size> </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> + </spacer> </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,1"> + <property name="spacing"> + <number>4</number> + </property> <item> - <widget class="QComboBox" name="lineSpacingModeCombo"> + <widget class="FormWidget" name="labelLineSpacing"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip"> - <string>Select the line spacing mode</string> + <property name="label" stdset="0"> + <string>Line Spacing</string> </property> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QComboBox" name="lineSpacingModeCombo"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Select the line spacing mode</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="ScrSpinBox" name="lineSpacing"> + <widget class="FormWidget" name="labelLineHeight"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip"> - <string>Line Spacing</string> + <property name="label" stdset="0"> + <string>Line Height</string> </property> - <property name="suffix"> - <string> pt</string> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_14"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ScrSpinBox" name="lineSpacing"> + <property name="toolTip"> + <string>Line Spacing</string> + </property> + <property name="suffix"> + <string> pt</string> + </property> + </widget> + </item> + </layout> </widget> </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <property name="spacing"> - <number>3</number> - </property> <item> - <widget class="QLabel" name="textAlignmentLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="AlignSelect" name="textAlignment" native="true"/> - </item> - <item alignment="Qt::AlignLeft"> - <widget class="DirectionSelect" name="textDirection" native="true"/> - </item> - <item> - <spacer name="horizontalSpacer_2"> + <spacer name="horizontalSpacer_5"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> - <height>20</height> + <width>0</width> + <height>0</height> </size> </property> </spacer> @@ -178,143 +196,91 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> + <layout class="QHBoxLayout" name="horizontalLayout_6" stretch="0,0,1"> <property name="spacing"> - <number>3</number> + <number>16</number> </property> <item> - <widget class="QLabel" name="langLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="langCombo"> + <widget class="FormWidget" name="labelTextColor"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip"> - <string>Text Language</string> + <property name="label" stdset="0"> + <string>Color</string> </property> - <property name="editable"> - <bool>true</bool> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ColorButton" name="buttonTextColor"> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> </widget> </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <property name="spacing"> - <number>3</number> - </property> <item> - <widget class="QLabel" name="paraStyleLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ParaStyleComboBox" name="paraStyleCombo"> + <widget class="FormWidget" name="labelBackgroundColor"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip"> - <string>Paragraph style of currently selected text or paragraph</string> + <property name="label" stdset="0"> + <string>Background</string> </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="ColorButton" name="buttonBackgroundColor"> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="QToolButton" name="paraStyleClear"> - <property name="toolTip"> - <string>Remove Direct Paragraph Formatting</string> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <widget class="QLabel" name="charStyleLabel"> - <property name="minimumSize"> + <property name="sizeHint" stdset="0"> <size> - <width>20</width> + <width>0</width> <height>0</height> </size> </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> + </spacer> </item> - <item> - <widget class="CharStyleComboBox" name="charStyleCombo"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Character style of currently selected text or paragraph</string> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="charStyleClear"> - <property name="toolTip"> - <string>Remove Direct Character Formatting</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> </layout> </item> </layout> @@ -321,38 +287,27 @@ </widget> <customwidgets> <customwidget> - <class>ScrSpinBox</class> - <extends>QDoubleSpinBox</extends> - <header>ui/scrspinbox.h</header> - </customwidget> - <customwidget> - <class>FontComboH</class> + <class>FormWidget</class> <extends>QWidget</extends> - <header>ui/fontcombo.h</header> + <header>ui/widgets/form_widget.h</header> <container>1</container> </customwidget> <customwidget> - <class>CharStyleComboBox</class> - <extends>QComboBox</extends> - <header>ui/stylecombos.h</header> + <class>ColorButton</class> + <extends>QToolButton</extends> + <header>ui/widgets/color_button.h</header> </customwidget> <customwidget> - <class>ParaStyleComboBox</class> - <extends>QComboBox</extends> - <header>ui/stylecombos.h</header> + <class>ScrSpinBox</class> + <extends>QDoubleSpinBox</extends> + <header location="global">ui/scrspinbox.h</header> </customwidget> <customwidget> - <class>AlignSelect</class> + <class>FontComboH</class> <extends>QWidget</extends> - <header>ui/alignselect.h</header> + <header>ui/fontcombo.h</header> <container>1</container> </customwidget> - <customwidget> - <class>DirectionSelect</class> - <extends>QWidget</extends> - <header>ui/directionselect.h</header> - <container>1</container> - </customwidget> </customwidgets> <resources/> <connections/> Index: scribus/ui/propertywidget_textcolor.cpp =================================================================== --- scribus/ui/propertywidget_textcolor.cpp (Revision 26312) +++ scribus/ui/propertywidget_textcolor.cpp (nicht existent) @@ -1,517 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ - -#include <QLocale> -#include "appmodes.h" -#include "iconmanager.h" -#include "localemgr.h" -#include "pageitem_table.h" -#include "propertywidget_textcolor.h" -#include "scribus.h" -#include "scribusapp.h" -#include "selection.h" - -PropertyWidget_TextColor::PropertyWidget_TextColor(QWidget* parent) : QFrame(parent) -{ - setupUi(this); - - layout()->setAlignment(Qt::AlignLeft); - - fillLayout->setAlignment(Qt::AlignLeft); - fillColor->setPixmapType(ColorCombo::fancyPixmaps); - fillIcon->setScaledContents( false ); - - strokeLayout->setAlignment(Qt::AlignLeft); - strokeColor->setPixmapType(ColorCombo::fancyPixmaps); - strokeIcon->setScaledContents( false ); - - backLayout->setAlignment(Qt::AlignLeft); - backColor->setPixmapType(ColorCombo::fancyPixmaps); - backIcon->setScaledContents( false ); - - effectsLayout->setAlignment(Qt::AlignLeft); - - iconSetChange(); - languageChange(); - - strokeIcon->setEnabled(false); - strokeColor->setEnabled(false); - strokeShade->setEnabled(false); - - connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); - connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); - -} - -void PropertyWidget_TextColor::setMainWindow(ScribusMainWindow *mw) -{ - m_ScMW = mw; - - connect(m_ScMW, SIGNAL(UpdateRequest(int)), this, SLOT(handleUpdateRequest(int))); -} - -void PropertyWidget_TextColor::setDoc(ScribusDoc *d) -{ - if ((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning())) - return; - - if (m_doc) - { - disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); - disconnect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); - } - - m_doc = d; - m_item = nullptr; - - if (m_doc.isNull()) - { - disconnectSignals(); - return; - } - - updateColorList(); - - connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); - connect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); -} - -void PropertyWidget_TextColor::setCurrentItem(PageItem *item) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - //CB We shouldn't really need to process this if our item is the same one - //maybe we do if the item has been changed by scripter.. but that should probably - //set some status if so. - //FIXME: This won't work until when a canvas deselect happens, m_item must be nullptr. - //if (m_item == i) - // return; - - disconnectSignals(); - - m_item = item; - if (item && m_doc.isNull()) - setDoc(item->doc()); - - configureWidgets(); - - if (m_item == nullptr) - return; - if (!m_item->isTable() && !m_item->isTextFrame() && !m_item->isPathText()) - return; - - if (m_item->isTextFrame() || m_item->isPathText() || m_item->isTable()) - { - ParagraphStyle parStyle = m_item->itemText.defaultStyle(); - if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable) - m_item->currentTextProps(parStyle); - updateStyle(parStyle); - } - connectSignals(); -} - -void PropertyWidget_TextColor::connectSignals() -{ - connect(fillColor , SIGNAL(activated(int)), this, SLOT(handleTextFill()) , Qt::UniqueConnection); - connect(strokeColor , SIGNAL(activated(int)), this, SLOT(handleTextStroke()) , Qt::UniqueConnection); - connect(fillShade , SIGNAL(clicked()) , this, SLOT(handleTextShade()) , Qt::UniqueConnection); - connect(strokeShade , SIGNAL(clicked()) , this, SLOT(handleTextShade()) , Qt::UniqueConnection); - connect(backShade , SIGNAL(clicked()) , this, SLOT(handleTextShade()) , Qt::UniqueConnection); - connect(backColor , SIGNAL(activated(int)), this, SLOT(handleTextBackground()) , Qt::UniqueConnection); - - connect(textEffects, SIGNAL(State(int)) , this, SLOT(handleTypeStyle(int)), Qt::UniqueConnection); - connect(textEffects->ShadowVal->Xoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs()), Qt::UniqueConnection); - connect(textEffects->ShadowVal->Yoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs()), Qt::UniqueConnection); - connect(textEffects->OutlineVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleOutlineWidth()), Qt::UniqueConnection); - connect(textEffects->UnderlineVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleUnderline()) , Qt::UniqueConnection); - connect(textEffects->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(handleUnderline()) , Qt::UniqueConnection); - connect(textEffects->StrikeVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru()), Qt::UniqueConnection); - connect(textEffects->StrikeVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru()), Qt::UniqueConnection); -} - -void PropertyWidget_TextColor::disconnectSignals() -{ - disconnect(fillColor , SIGNAL(activated(int)), this, SLOT(handleTextFill())); - disconnect(strokeColor , SIGNAL(activated(int)), this, SLOT(handleTextStroke())); - disconnect(fillShade , SIGNAL(clicked()) , this, SLOT(handleTextShade())); - disconnect(strokeShade , SIGNAL(clicked()) , this, SLOT(handleTextShade())); - disconnect(backShade , SIGNAL(clicked()) , this, SLOT(handleTextShade())); - disconnect(backColor , SIGNAL(activated(int)), this, SLOT(handleTextBackground())); - - disconnect(textEffects, SIGNAL(State(int)) , this, SLOT(handleTypeStyle(int))); - disconnect(textEffects->ShadowVal->Xoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs())); - disconnect(textEffects->ShadowVal->Yoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs())); - disconnect(textEffects->OutlineVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleOutlineWidth())); - disconnect(textEffects->UnderlineVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleUnderline())); - disconnect(textEffects->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(handleUnderline())); - disconnect(textEffects->StrikeVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru())); - disconnect(textEffects->StrikeVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru())); -} - -void PropertyWidget_TextColor::configureWidgets() -{ - bool enabled = false; - if (m_item && m_doc) - { - if (m_item->isPathText() || m_item->isTextFrame() || m_item->isTable()) - enabled = true; - if ((m_item->isGroup()) && (!m_item->isSingleSel)) - enabled = false; - if (m_item->isOSGFrame() || m_item->isSymbol()) - enabled = false; - if (m_doc->m_Selection->count() > 1) - enabled = false; - } - setEnabled(enabled); -} - -void PropertyWidget_TextColor::handleSelectionChanged() -{ - if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - - PageItem* currItem = currentItemFromSelection(); - setCurrentItem(currItem); - updateGeometry(); -} - -void PropertyWidget_TextColor::handleUpdateRequest(int updateFlags) -{ - if (updateFlags & reqColorsUpdate) - updateColorList(); -} - -void PropertyWidget_TextColor::updateColorList() -{ - if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - - if (m_item) - disconnectSignals(); - - fillColor->setColors(m_doc->PageColors, true); - strokeColor->setColors(m_doc->PageColors, false); - backColor->setColors(m_doc->PageColors, true); - - if (m_item) - setCurrentItem(m_item); -} - -void PropertyWidget_TextColor::updateCharStyle(const CharStyle& charStyle) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - - showOutlineW (charStyle.outlineWidth()); - showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset()); - showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.backColor(), charStyle.strokeShade(), charStyle.fillShade(), charStyle.backShade()); - showTextEffects(charStyle.effects()); - showStrikeThru(charStyle.strikethruOffset() , charStyle.strikethruWidth()); - showUnderline (charStyle.underlineOffset(), charStyle.underlineWidth()); -} - -void PropertyWidget_TextColor::updateStyle(const ParagraphStyle& newCurrent) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - - const CharStyle& charStyle = newCurrent.charStyle(); - - showOutlineW (charStyle.outlineWidth()); - showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset()); - showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.backColor(), charStyle.strokeShade(), charStyle.fillShade(), charStyle.backShade()); - showTextEffects(charStyle.effects()); - showStrikeThru(charStyle.strikethruOffset() , charStyle.strikethruWidth()); - showUnderline (charStyle.underlineOffset(), charStyle.underlineWidth()); -} - -void PropertyWidget_TextColor::showOutlineW(double x) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - textEffects->OutlineVal->LWidth->showValue(x / 10.0); -} - -void PropertyWidget_TextColor::showShadowOffset(double x, double y) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - textEffects->ShadowVal->Xoffset->showValue(x / 10.0); - textEffects->ShadowVal->Yoffset->showValue(y / 10.0); -} - -void PropertyWidget_TextColor::showStrikeThru(double p, double w) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - textEffects->StrikeVal->LPos->showValue(p / 10.0); - textEffects->StrikeVal->LWidth->showValue(w / 10.0); -} - -void PropertyWidget_TextColor::showTextColors(const QString& strokeCol, const QString& fillCol, const QString& backCol, double strokeShd, double fillShd, double backShd) -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - - QSignalBlocker fillShadeBlocker(fillShade); - QSignalBlocker strokeShadeBlocker(strokeShade); - QSignalBlocker backShadeBlocker(backShade); - QSignalBlocker fillColorBlocker(fillColor); - QSignalBlocker strokeColorBlocker(strokeColor); - QSignalBlocker backColorBlocker(backColor); - - fillShade->setValue(qRound(fillShd)); - strokeShade->setValue(qRound(strokeShd)); - backShade->setValue(qRound(backShd)); - - if (!fillCol.isEmpty()) - fillColor->setCurrentColor(fillCol); - if (!strokeCol.isEmpty()) - strokeColor->setCurrentColor(strokeCol); - if (!backCol.isEmpty()) - backColor->setCurrentColor(backCol); -} - -void PropertyWidget_TextColor::showTextEffects(int s) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - strokeIcon->setEnabled(false); - strokeColor->setEnabled(false); - strokeShade->setEnabled(false); - textEffects->setStyle(s); - if ((s & 4) || (s & 256)) - { - strokeIcon->setEnabled(true); - strokeColor->setEnabled(true); - strokeShade->setEnabled(true); - } -} - -void PropertyWidget_TextColor::handleOutlineWidth() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - int x = qRound(textEffects->OutlineVal->LWidth->value() * 10.0); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetOutlineWidth(x, &tempSelection); - } -} - -void PropertyWidget_TextColor::handleShadowOffs() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - int x = qRound(textEffects->ShadowVal->Xoffset->value() * 10.0); - int y = qRound(textEffects->ShadowVal->Yoffset->value() * 10.0); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetShadowOffsets(x, y, &tempSelection); - } -} - -void PropertyWidget_TextColor::handleStrikeThru() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - int x = qRound(textEffects->StrikeVal->LPos->value() * 10.0); - int y = qRound(textEffects->StrikeVal->LWidth->value() * 10.0); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetStrikethru(x, y, &tempSelection); - } -} - -void PropertyWidget_TextColor::handleTextFill() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetFillColor(fillColor->currentColor(), &tempSelection); - } -} - -void PropertyWidget_TextColor::handleTextStroke() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetStrokeColor(strokeColor->currentColor(), &tempSelection); - } -} - -void PropertyWidget_TextColor::handleTextBackground() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetBackgroundColor(backColor->currentColor(), &tempSelection); - } -} - -void PropertyWidget_TextColor::handleTextShade() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - if (strokeShade == sender()) - { - int b = strokeShade->getValue(); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetStrokeShade(b, &tempSelection); - } - } - else if (fillShade == sender()) - { - int b = fillShade->getValue(); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetFillShade(b, &tempSelection); - } - } - else if (backShade == sender()) - { - int b = backShade->getValue(); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetBackgroundShade(b, &tempSelection); - } - } -} - -void PropertyWidget_TextColor::handleTypeStyle(int s) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetEffects(s, &tempSelection); - m_ScMW->setStyleEffects(s); - } -} - -void PropertyWidget_TextColor::showUnderline(double p, double w) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - textEffects->UnderlineVal->LPos->showValue(p / 10.0); - textEffects->UnderlineVal->LWidth->showValue(w / 10.0); -} - -void PropertyWidget_TextColor::handleUnderline() -{ - if ((m_doc) && (m_item)) - { - int x = qRound(textEffects->UnderlineVal->LPos->value() * 10.0); - int y = qRound(textEffects->UnderlineVal->LWidth->value() * 10.0); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetUnderline(x, y, &tempSelection); - } - } -} - -void PropertyWidget_TextColor::changeEvent(QEvent *e) -{ - if (e->type() == QEvent::LanguageChange) - { - languageChange(); - return; - } - QWidget::changeEvent(e); -} - -void PropertyWidget_TextColor::iconSetChange() -{ - IconManager& iconManager = IconManager::instance(); - - fillIcon->setPixmap(iconManager.loadPixmap("16/color-fill.png")); - fillShadeLabel->setPixmap(iconManager.loadPixmap("shade.png")); - - strokeIcon->setPixmap(iconManager.loadPixmap("16/color-stroke.png")); - strokeShadeLabel->setPixmap(iconManager.loadPixmap("shade.png")); - - backIcon->setPixmap(iconManager.loadPixmap("16/color-fill.png")); - backShadeLabel->setPixmap(iconManager.loadPixmap("shade.png")); -} - -void PropertyWidget_TextColor::languageChange() -{ - retranslateUi(this); - textEffects->languageChange(); -} - -void PropertyWidget_TextColor::localeChange() -{ - const QLocale& l(LocaleManager::instance().userPreferredLocale()); - textEffects->ShadowVal->Xoffset->setLocale(l); - textEffects->ShadowVal->Yoffset->setLocale(l); - textEffects->OutlineVal->LWidth->setLocale(l); - textEffects->UnderlineVal->LPos->setLocale(l); - textEffects->UnderlineVal->LWidth->setLocale(l); - textEffects->StrikeVal->LPos->setLocale(l); - textEffects->StrikeVal->LWidth->setLocale(l); -} Index: scribus/ui/propertywidget_textcolor.h =================================================================== --- scribus/ui/propertywidget_textcolor.h (Revision 26312) +++ scribus/ui/propertywidget_textcolor.h (nicht existent) @@ -1,74 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ -#ifndef PROPERTYWIDGET_TEXTCOLOR_H -#define PROPERTYWIDGET_TEXTCOLOR_H - -#include "ui_propertywidget_textcolorbase.h" - -#include "propertywidgetbase.h" - -class ScribusDoc; -class ScribusMainWindow; - -class PropertyWidget_TextColor : public QFrame, Ui::PropertyWidget_TextColorBase, - public PropertyWidgetBase -{ - Q_OBJECT - -public: - PropertyWidget_TextColor(QWidget* parent); - ~PropertyWidget_TextColor() {}; - - void updateColorList(); - void setCurrentItem(PageItem *item); - -protected: - PageItem *m_item {nullptr}; - ScribusMainWindow* m_ScMW {nullptr}; - - void connectSignals(); - void disconnectSignals(); - - void configureWidgets(); - - void changeEvent(QEvent *e) override; - -public slots: - void setMainWindow(ScribusMainWindow *mw); - void setDoc(ScribusDoc *d); - - void handleSelectionChanged(); - void handleUpdateRequest(int); - - void iconSetChange(); - void languageChange(); - void unitChange() {}; - void localeChange(); - - void showOutlineW(double x); - void showShadowOffset(double x, double y); - void showStrikeThru(double p, double w); - void showTextColors(const QString& strokeCol, const QString& fillCol, const QString& backCol, double strokeShd, double fillShd, double backShd); - void showTextEffects(int s); - void showUnderline(double p, double w); - - void updateCharStyle(const CharStyle& charStyle); - void updateStyle(const ParagraphStyle& newCurrent); - -private slots: - void handleOutlineWidth(); - void handleShadowOffs(); - void handleStrikeThru(); - void handleTextFill(); - void handleTextShade(); - void handleTextStroke(); - void handleTextBackground(); - void handleTypeStyle(int s); - void handleUnderline(); -}; - -#endif Index: scribus/ui/propertywidget_textcolorbase.ui =================================================================== --- scribus/ui/propertywidget_textcolorbase.ui (Revision 26312) +++ scribus/ui/propertywidget_textcolorbase.ui (nicht existent) @@ -1,281 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>PropertyWidget_TextColorBase</class> - <widget class="QFrame" name="PropertyWidget_TextColorBase"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>167</width> - <height>135</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>3</number> - </property> - <property name="topMargin"> - <number>3</number> - </property> - <property name="rightMargin"> - <number>3</number> - </property> - <property name="bottomMargin"> - <number>3</number> - </property> - <item> - <layout class="QHBoxLayout" name="fillLayout"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <widget class="QLabel" name="fillIcon"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ColorCombo" name="fillColor"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Color of selected text. If Outline text decoration is enabled, this color will be the fill color.<br/>If Drop Shadow Text is enabled, then this will be the top most color.</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="fillShadeLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ShadeButton" name="fillShade"> - <property name="toolTip"> - <string>Saturation of color of text fill</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="strokeLayout"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <widget class="QLabel" name="strokeIcon"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ColorCombo" name="strokeColor"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="tabletTracking"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Color of text stroke and/or drop shadow, depending which is chosen.<br/>If both are chosen, then they share the same color.</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="strokeShadeLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ShadeButton" name="strokeShade"> - <property name="toolTip"> - <string>Saturation of color of text stroke</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="backLayout"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <widget class="QLabel" name="backIcon"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ColorCombo" name="backColor"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Background color of selected text</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="backShadeLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ShadeButton" name="backShade"> - <property name="toolTip"> - <string>Saturation of color of text background</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="effectsLayout"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="StyleSelect" name="textEffects" native="true"/> - </item> - </layout> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>ColorCombo</class> - <extends>QComboBox</extends> - <header>ui/colorcombo.h</header> - </customwidget> - <customwidget> - <class>ShadeButton</class> - <extends>QToolButton</extends> - <header>ui/shadebutton.h</header> - </customwidget> - <customwidget> - <class>StyleSelect</class> - <extends>QWidget</extends> - <header>ui/styleselect.h</header> - <container>1</container> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> Index: scribus/ui/smalignselect.cpp =================================================================== --- scribus/ui/smalignselect.cpp (Revision 26312) +++ scribus/ui/smalignselect.cpp (Arbeitskopie) @@ -6,18 +6,22 @@ */ #include <QToolTip> #include "smalignselect.h" +#include "iconmanager.h" +#include "scribusapp.h" - SMAlignSelect::SMAlignSelect(QWidget *parent) : AlignSelect(parent) { parentButton = new QToolButton(this); - parentButton->setCheckable( true ); - parentButton->setText( tr("P", "P as in Parent")); + parentButton->setText( ""); parentButton->setToolTip( tr("Use parent style's alignment instead of overriding it")); - GroupAlignLayout->addWidget( parentButton ); + addWidget( parentButton ); resize(minimumSizeHint()); parentButton->hide(); + + iconSetChange(); + + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); } void SMAlignSelect::setStyle(int a, int d) @@ -24,7 +28,6 @@ { disconnect(this, SIGNAL(State(int)), this, SLOT(styleChanged())); disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed())); - setFont(false); m_hasParent = false; m_pStyle = 0; m_pDirection = 0; @@ -39,7 +42,6 @@ m_hasParent = true; m_pStyle = a; m_pDirection = d; - setFont(!isParentValue); if (isParentValue) parentButton->hide(); else @@ -67,20 +69,10 @@ return ret; } -void SMAlignSelect::setFont(bool wantBold) -{ - QFont f(font()); - f.setBold(wantBold); - parentButton->setFont(f); -} - void SMAlignSelect::styleChanged() { if (m_hasParent) - { - setFont(true); parentButton->show(); - } } void SMAlignSelect::pbPressed() @@ -87,3 +79,9 @@ { m_useParentStyle = true; } + +void SMAlignSelect::iconSetChange() +{ + IconManager &im = IconManager::instance(); + parentButton->setIcon(im.loadIcon("reset")); +} Index: scribus/ui/smalignselect.h =================================================================== --- scribus/ui/smalignselect.h (Revision 26312) +++ scribus/ui/smalignselect.h (Arbeitskopie) @@ -31,11 +31,10 @@ int m_pStyle = 0; int m_pDirection = 0; - void setFont(bool wantBold); - private slots: void styleChanged(); void pbPressed(); + void iconSetChange(); }; #endif Index: scribus/ui/smcstylewidget.cpp =================================================================== --- scribus/ui/smcstylewidget.cpp (Revision 26312) +++ scribus/ui/smcstylewidget.cpp (Arbeitskopie) @@ -43,6 +43,8 @@ hyphenCharLineEdit->setMaxLength(1); + fontFace_->setGuestWidget(fontSizeLabel_); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(effects_, SIGNAL(State(int)), this, SLOT(slotColorChange())); @@ -63,12 +65,12 @@ { IconManager& im = IconManager::instance(); - fontSizeLabel_->setPixmap(im.loadPixmap("zeichen.png")); - trackingLabel_->setPixmap(im.loadPixmap("textkern.png")); - widthSpaceLabel->setPixmap(im.loadPixmap("spacewidth.png")); - baselineOffsetLabel_->setPixmap(im.loadPixmap("textbase.png")); - hscaleLabel_->setPixmap(im.loadPixmap("textscaleh.png")); - vscaleLabel_->setPixmap(im.loadPixmap("textscalev.png")); + fontSizeLabel_->setPixmap(im.loadPixmap("font-size")); + trackingLabel_->setPixmap(im.loadPixmap("character-letter-tracking")); + widthSpaceLabel->setPixmap(im.loadPixmap("character-space-width")); + baselineOffsetLabel_->setPixmap(im.loadPixmap("character-offset-baseline")); + hscaleLabel_->setPixmap(im.loadPixmap("character-scale-width")); + vscaleLabel_->setPixmap(im.loadPixmap("character-scale-height")); FillIcon->setPixmap(im.loadPixmap("16/color-fill.png")); fillShadeLabel->setPixmap(im.loadPixmap("shade.png")); StrokeIcon->setPixmap(im.loadPixmap("16/color-stroke.png")); @@ -75,6 +77,9 @@ strokeShadeLabel->setPixmap(im.loadPixmap("shade.png")); backIcon->setPixmap(im.loadPixmap("16/color-fill.png")); backShadeLabel->setPixmap(im.loadPixmap("shade.png")); + languageLabel_->setPixmap(im.loadPixmap("paragraph-language")); + hyphenationCharacterLabel->setPixmap(im.loadPixmap("hyphen-character")); + smallestWordLabel->setPixmap(im.loadPixmap("hyphen-smallest-word")); } void SMCStyleWidget::languageChange() Index: scribus/ui/smcstylewidget.ui =================================================================== --- scribus/ui/smcstylewidget.ui (Revision 26312) +++ scribus/ui/smcstylewidget.ui (Arbeitskopie) @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>531</width> - <height>492</height> + <width>472</width> + <height>555</height> </rect> </property> <property name="sizePolicy"> @@ -17,6 +17,18 @@ </sizepolicy> </property> <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> <widget class="QTabWidget" name="tabwidget"> <property name="sizePolicy"> @@ -40,43 +52,58 @@ </attribute> <layout class="QVBoxLayout" name="verticalLayout_6"> <item> - <layout class="QVBoxLayout" name="verticalLayout_2"> + <layout class="QHBoxLayout" name="_3"> <item> - <layout class="QHBoxLayout" name="_3"> - <item> - <widget class="QLabel" name="parentLabel"> - <property name="text"> - <string>Based On:</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - <property name="buddy"> - <cstring>parentCombo</cstring> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="parentCombo"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>5</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Parent Style</string> - </property> - </widget> - </item> - </layout> + <widget class="QLabel" name="parentLabel"> + <property name="text"> + <string>Based On:</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + <property name="buddy"> + <cstring>parentCombo</cstring> + </property> + </widget> </item> <item> - <widget class="QGroupBox" name="basicGroup"> - <property name="title"> - <string>Basic Formatting</string> + <widget class="QComboBox" name="parentCombo"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>5</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <layout class="QVBoxLayout" name="_4"> + <property name="toolTip"> + <string>Parent Style</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QGroupBox" name="basicGroup"> + <property name="title"> + <string>Font</string> + </property> + <layout class="QVBoxLayout" name="_4"> + <property name="spacing"> + <number>8</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_10"> <item> <widget class="SMFontComboH" name="fontFace_" native="true"> <property name="sizePolicy"> @@ -87,136 +114,584 @@ </property> <property name="minimumSize"> <size> + <width>50</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="FormWidget" name="fontSizeLabel_"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>Size</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="fontSize_"> + <property name="toolTip"> + <string>Font Size</string> + </property> + <property name="minimum"> + <double>1.000000000000000</double> + </property> + <property name="maximum"> + <double>2048.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> <width>0</width> <height>20</height> </size> </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="advGroup"> + <property name="title"> + <string>Typography</string> + </property> + <layout class="QVBoxLayout" name="_7"> + <property name="spacing"> + <number>8</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> + <item> + <layout class="QHBoxLayout" name="_6"> + <item> + <widget class="SMStyleSelect" name="effects_" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> </widget> </item> <item> - <layout class="QHBoxLayout" name="_5"> + <spacer> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Policy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <layout class="QGridLayout" name="gridLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="horizontalSpacing"> + <number>16</number> + </property> + <property name="verticalSpacing"> + <number>4</number> + </property> + <item row="0" column="2"> + <spacer> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="0"> + <widget class="FormWidget" name="baselineOffsetLabel_"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="baselineOffset_"> + <property name="toolTip"> + <string>Offset to baseline of characters</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + <property name="minimum"> + <double>-100.000000000000000</double> + </property> + <property name="maximum"> + <double>100.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="0" column="1"> + <widget class="FormWidget" name="trackingLabel_"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="tracking_"> + <property name="toolTip"> + <string>Tracking</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + <property name="minimum"> + <double>-300.000000000000000</double> + </property> + <property name="maximum"> + <double>300.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="0"> + <widget class="FormWidget" name="hscaleLabel_"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="fontHScale_"> + <property name="toolTip"> + <string>Scaling width of characters</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + <property name="minimum"> + <double>10.000000000000000</double> + </property> + <property name="maximum"> + <double>400.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="1"> + <widget class="FormWidget" name="vscaleLabel_"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="fontVScale_"> + <property name="toolTip"> + <string>Scaling height of characters</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + <property name="minimum"> + <double>10.000000000000000</double> + </property> + <property name="maximum"> + <double>400.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="2" column="1"> + <widget class="FormWidget" name="widthSpaceLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="widthSpaceSpin"> + <property name="toolTip"> + <string>Default width for space</string> + </property> + <property name="suffix"> + <string> %</string> + </property> + <property name="minimum"> + <double>1.000000000000000</double> + </property> + <property name="maximum"> + <double>199.000000000000000</double> + </property> + <property name="value"> + <double>100.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_18"> + <property name="spacing"> + <number>8</number> + </property> + <item> + <widget class="QGroupBox" name="smColorGroup"> + <property name="title"> + <string>Colors</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>8</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> + <item> + <layout class="QHBoxLayout" name="_2"> + <property name="spacing"> + <number>16</number> + </property> <item> - <widget class="QLabel" name="fontSizeLabel_"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> + <widget class="FormWidget" name="FillIcon"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> + <property name="label" stdset="0"> <string/> </property> - <property name="buddy"> - <cstring>fontSize_</cstring> - </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMColorCombo" name="fillColor_"> + <property name="toolTip"> + <string>Fill Color</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="SMScrSpinBox" name="fontSize_"> - <property name="toolTip"> - <string>Font Size</string> + <widget class="FormWidget" name="fillShadeLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="minimum"> - <double>1.000000000000000</double> + <property name="label" stdset="0"> + <string/> </property> - <property name="maximum"> - <double>2048.000000000000000</double> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_13"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMShadeButton" name="fillShade_"> + <property name="toolTip"> + <string>Fill Shade</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="QLabel" name="trackingLabel_"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> + <spacer> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="maximumSize"> + <property name="sizeHint" stdset="0"> <size> - <width>22</width> - <height>22</height> + <width>0</width> + <height>20</height> </size> </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>tracking_</cstring> - </property> - </widget> + </spacer> </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="_10"> + <property name="spacing"> + <number>16</number> + </property> <item> - <widget class="SMScrSpinBox" name="tracking_"> - <property name="toolTip"> - <string>Tracking</string> + <widget class="FormWidget" name="StrokeIcon"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="suffix"> - <string> %</string> + <property name="label" stdset="0"> + <string/> </property> - <property name="minimum"> - <double>-300.000000000000000</double> - </property> - <property name="maximum"> - <double>300.000000000000000</double> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_14"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMColorCombo" name="strokeColor_"> + <property name="toolTip"> + <string>Stroke Color</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="QLabel" name="widthSpaceLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> + <widget class="FormWidget" name="strokeShadeLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> + <property name="label" stdset="0"> + <string/> </property> - <property name="textInteractionFlags"> - <set>Qt::NoTextInteraction</set> - </property> - <property name="buddy"> - <cstring>widthSpaceSpin</cstring> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_15"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMShadeButton" name="strokeShade_"> + <property name="toolTip"> + <string>Stroke Shade</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="SMScrSpinBox" name="widthSpaceSpin"> - <property name="toolTip"> - <string>Default width for space</string> - </property> - <property name="suffix"> - <string> %</string> - </property> - <property name="minimum"> - <double>1.000000000000000</double> - </property> - <property name="maximum"> - <double>199.000000000000000</double> - </property> - <property name="value"> - <double>100.000000000000000</double> - </property> - </widget> - </item> - <item> <spacer> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>0</width> <height>20</height> </size> </property> @@ -225,34 +700,89 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="_6"> + <layout class="QHBoxLayout" name="_11"> + <property name="spacing"> + <number>16</number> + </property> <item> - <widget class="SMStyleSelect" name="effects_" native="true"> + <widget class="FormWidget" name="backIcon"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> - <size> - <width>30</width> - <height>0</height> - </size> + <property name="label" stdset="0"> + <string/> </property> + <layout class="QHBoxLayout" name="horizontalLayout_16"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMColorCombo" name="backColor_"> + <property name="toolTip"> + <string>Background Color</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> + <widget class="FormWidget" name="backShadeLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_17"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMShadeButton" name="backShade_"> + <property name="toolTip"> + <string>Background Shade</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <spacer> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>0</width> <height>20</height> </size> </property> @@ -264,135 +794,76 @@ </widget> </item> <item> - <widget class="QGroupBox" name="advGroup"> + <widget class="QGroupBox" name="hyphenGroup"> <property name="title"> - <string>Advanced Formatting</string> + <string>Hyphenation</string> </property> - <layout class="QVBoxLayout" name="_7"> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <property name="spacing"> + <number>8</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> - <layout class="QHBoxLayout" name="_8"> + <layout class="QHBoxLayout" name="_9" stretch="0,1"> + <property name="spacing"> + <number>4</number> + </property> <item> - <widget class="QLabel" name="hscaleLabel_"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> + <widget class="FormWidget" name="languageLabel_"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> + <property name="label" stdset="0"> + <string>Language</string> </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>fontHScale_</cstring> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScComboBox" name="language_"> + <property name="toolTip"> + <string>Text Language</string> + </property> + <property name="editable"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="SMScrSpinBox" name="fontHScale_"> - <property name="toolTip"> - <string>Horizontal Scaling</string> - </property> - <property name="suffix"> - <string> %</string> - </property> - <property name="minimum"> - <double>10.000000000000000</double> - </property> - <property name="maximum"> - <double>400.000000000000000</double> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="vscaleLabel_"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>fontVScale_</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMScrSpinBox" name="fontVScale_"> - <property name="toolTip"> - <string>Vertical Scaling</string> - </property> - <property name="suffix"> - <string> %</string> - </property> - <property name="minimum"> - <double>10.000000000000000</double> - </property> - <property name="maximum"> - <double>400.000000000000000</double> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="baselineOffsetLabel_"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>baselineOffset_</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMScrSpinBox" name="baselineOffset_"> - <property name="toolTip"> - <string>Baseline Offset</string> - </property> - <property name="suffix"> - <string> %</string> - </property> - <property name="minimum"> - <double>-100.000000000000000</double> - </property> - <property name="maximum"> - <double>100.000000000000000</double> - </property> - </widget> - </item> - <item> <spacer> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>0</width> <height>20</height> </size> </property> @@ -401,35 +872,98 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="_9"> + <layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0,0,1"> + <property name="spacing"> + <number>16</number> + </property> <item> - <widget class="QLabel" name="languageLabel_"> - <property name="text"> - <string>Language:</string> + <widget class="FormWidget" name="smallestWordLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="buddy"> - <cstring>language_</cstring> + <property name="label" stdset="0"> + <string>Smallest Word</string> </property> + <layout class="QHBoxLayout" name="horizontalLayout_12"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMSpinBox" name="smallestWordSpinBox"> + <property name="toolTip"> + <string>Length of the smallest word to be hyphenated</string> + </property> + <property name="suffix"> + <string> characters</string> + </property> + <property name="minimum"> + <number>3</number> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="SMScComboBox" name="language_"> - <property name="toolTip"> - <string>Language</string> + <widget class="FormWidget" name="hyphenationCharacterLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="editable"> - <bool>true</bool> + <property name="label" stdset="0"> + <string>Character</string> </property> + <layout class="QHBoxLayout" name="horizontalLayout_11"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMLineEdit" name="hyphenCharLineEdit"> + <property name="maximumSize"> + <size> + <width>60</width> + <height>16777215</height> + </size> + </property> + <property name="toolTip"> + <string>The character used for automatic hyphen. Can be empty.</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <spacer> + <spacer name="horizontalSpacer_2"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>0</width> <height>20</height> </size> </property> @@ -437,355 +971,31 @@ </item> </layout> </item> + <item> + <spacer> + <property name="orientation"> + <enum>Qt::Orientation::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Policy::MinimumExpanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>0</height> + </size> + </property> + </spacer> + </item> </layout> </widget> </item> - <item> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QGroupBox" name="smColorGroup"> - <property name="title"> - <string>Colors</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <layout class="QHBoxLayout" name="_2"> - <item> - <widget class="QLabel" name="FillIcon"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>fillColor_</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMColorCombo" name="fillColor_"> - <property name="toolTip"> - <string>Fill Color</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="fillShadeLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>fillShade_</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMShadeButton" name="fillShade_"> - <property name="toolTip"> - <string>Fill Shade</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="_10"> - <item> - <widget class="QLabel" name="StrokeIcon"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>strokeColor_</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMColorCombo" name="strokeColor_"> - <property name="toolTip"> - <string>Stroke Color</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="strokeShadeLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>strokeShade_</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMShadeButton" name="strokeShade_"> - <property name="toolTip"> - <string>Stroke Shade</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="_11"> - <item> - <widget class="QLabel" name="backIcon"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>fillColor_</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMColorCombo" name="backColor_"> - <property name="toolTip"> - <string>Background Color</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="backShadeLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>fillShade_</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMShadeButton" name="backShade_"> - <property name="toolTip"> - <string>Background Shade</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item row="0" column="1"> - <widget class="QGroupBox" name="hyphenGroup"> - <property name="title"> - <string>Hyphenation</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QLabel" name="label_4"> - <property name="text"> - <string>Hyphenation Character:</string> - </property> - </widget> - </item> - <item> - <widget class="SMLineEdit" name="hyphenCharLineEdit"> - <property name="maximumSize"> - <size> - <width>60</width> - <height>16777215</height> - </size> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>0</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="smallestWordLabel"> - <property name="text"> - <string>Smallest Word:</string> - </property> - </widget> - </item> - <item> - <widget class="SMSpinBox" name="smallestWordSpinBox"> - <property name="suffix"> - <string> characters</string> - </property> - <property name="minimum"> - <number>3</number> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>0</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <spacer> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::MinimumExpanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - </layout> - </item> </layout> </item> <item> <spacer name="verticalSpacer"> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Orientation::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -805,7 +1015,7 @@ </sizepolicy> </property> <attribute name="title"> - <string>Font Features</string> + <string>OpenType Features</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_5"> <property name="leftMargin"> @@ -831,6 +1041,12 @@ </widget> <customwidgets> <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + <customwidget> <class>SMScComboBox</class> <extends>QComboBox</extends> <header>ui/smsccombobox.h</header> @@ -851,6 +1067,11 @@ <header>ui/smshadebutton.h</header> </customwidget> <customwidget> + <class>SMSpinBox</class> + <extends>QSpinBox</extends> + <header>ui/smspinbox.h</header> + </customwidget> + <customwidget> <class>SMFontComboH</class> <extends>QWidget</extends> <header>ui/smfontcomboh.h</header> @@ -863,11 +1084,6 @@ <container>1</container> </customwidget> <customwidget> - <class>SMSpinBox</class> - <extends>QSpinBox</extends> - <header>ui/smspinbox.h</header> - </customwidget> - <customwidget> <class>SMFontFeatures</class> <extends>QWidget</extends> <header>ui/smfontfeatures.h</header> @@ -879,6 +1095,25 @@ <header>ui/smlineedit.h</header> </customwidget> </customwidgets> + <tabstops> + <tabstop>tabwidget</tabstop> + <tabstop>parentCombo</tabstop> + <tabstop>fontSize_</tabstop> + <tabstop>baselineOffset_</tabstop> + <tabstop>tracking_</tabstop> + <tabstop>fontHScale_</tabstop> + <tabstop>fontVScale_</tabstop> + <tabstop>widthSpaceSpin</tabstop> + <tabstop>fillColor_</tabstop> + <tabstop>fillShade_</tabstop> + <tabstop>strokeColor_</tabstop> + <tabstop>strokeShade_</tabstop> + <tabstop>backColor_</tabstop> + <tabstop>backShade_</tabstop> + <tabstop>language_</tabstop> + <tabstop>smallestWordSpinBox</tabstop> + <tabstop>hyphenCharLineEdit</tabstop> + </tabstops> <resources/> <connections/> </ui> Index: scribus/ui/smdirectionselect.cpp =================================================================== --- scribus/ui/smdirectionselect.cpp (Revision 26312) +++ scribus/ui/smdirectionselect.cpp (Arbeitskopie) @@ -1,15 +1,20 @@ #include "smdirectionselect.h" +#include "iconmanager.h" +#include "scribusapp.h" SMDirectionSelect::SMDirectionSelect(QWidget *parent) : DirectionSelect(parent) { parentButton = new QToolButton(this); - parentButton->setCheckable( true ); - parentButton->setText( tr("P", "P as in Parent")); + parentButton->setText( "" ); parentButton->setToolTip( tr("Use parent style's direction instead of overriding it")); - groupSelectLayout->addWidget( parentButton ); + addWidget( parentButton ); resize(minimumSizeHint()); parentButton->hide(); + + iconSetChange(); + + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); } void SMDirectionSelect::setStyle(int i) @@ -16,7 +21,6 @@ { disconnect(this, SIGNAL(State(int)), this, SLOT(styleChanged())); disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed())); - setFont(false); m_hasParent = false; m_pStyle = 0; parentButton->hide(); @@ -29,7 +33,6 @@ disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed())); m_hasParent = true; m_pStyle = i; - setFont(!isParentValue); if (isParentValue) parentButton->hide(); else @@ -56,20 +59,10 @@ return ret; } -void SMDirectionSelect::setFont(bool wantBold) -{ - QFont f(font()); - f.setBold(wantBold); - parentButton->setFont(f); -} - void SMDirectionSelect::styleChanged() { if (m_hasParent) - { - setFont(true); parentButton->show(); - } } void SMDirectionSelect::pbPressed() @@ -76,3 +69,9 @@ { m_useParentStyle = true; } + +void SMDirectionSelect::iconSetChange() +{ + IconManager &im = IconManager::instance(); + parentButton->setIcon(im.loadIcon("reset")); +} Index: scribus/ui/smdirectionselect.h =================================================================== --- scribus/ui/smdirectionselect.h (Revision 26312) +++ scribus/ui/smdirectionselect.h (Arbeitskopie) @@ -23,11 +23,10 @@ bool m_useParentStyle = false; int m_pStyle = 0; - void setFont(bool wantBold); - private slots: void styleChanged(); void pbPressed(); + void iconSetChange(); }; #endif // SMDIRECTIONSELECT_H Index: scribus/ui/smpstylewidget.cpp =================================================================== --- scribus/ui/smpstylewidget.cpp (Revision 26312) +++ scribus/ui/smpstylewidget.cpp (Arbeitskopie) @@ -41,9 +41,9 @@ backColor_->clear(); backColor_->addItem(CommonStrings::tr_NoneColor); - lineSpacingMode->addItem( tr("Fixed Linespacing")); - lineSpacingMode->addItem( tr("Automatic Linespacing")); - lineSpacingMode->addItem( tr("Align to Baseline Grid")); + lineSpacingMode->addItem( tr("Fixed")); + lineSpacingMode->addItem( tr("Automatic")); + lineSpacingMode->addItem( tr("Baseline")); connect(lineSpacingMode, SIGNAL(highlighted(int)), this, SLOT(slotLineSpacingModeChanged(int))); lineSpacing->setSuffix(unitGetSuffixFromIndex(0)); @@ -65,6 +65,10 @@ numStartSpin->setMaximum(9999); numLevelSpin->setMinimum(1); numLevelSpin->setMaximum(1); + numPrefix->setMaxLength(5); + numPrefix->setMaximumWidth(QFontMetrics(numPrefix->font()).averageCharWidth() * 7); + numSuffix->setMaxLength(5); + numSuffix->setMaximumWidth(QFontMetrics(numSuffix->font()).averageCharWidth() * 7); fillNumRestartCombo(); dropCapLines->setMinimum(2); dropCapLines->setMaximum(99); @@ -100,15 +104,21 @@ { IconManager& iconManager = IconManager::instance(); - lineSpacingLabel->setPixmap(iconManager.loadPixmap("linespacing2.png")); - spaceAboveLabel->setPixmap(iconManager.loadPixmap("above.png") ); - spaceBelowLabel->setPixmap(iconManager.loadPixmap("below.png") ); - keepLabelStart->setPixmap(iconManager.loadPixmap("22/orphan.png") ); - keepLabelEnd->setPixmap(iconManager.loadPixmap("22/widow.png") ); + lineSpacingLabel->setPixmap(iconManager.loadPixmap("paragraph-line-height")); + spaceAboveLabel->setPixmap(iconManager.loadPixmap("paragraph-space-above") ); + spaceBelowLabel->setPixmap(iconManager.loadPixmap("paragraph-space-below") ); + keepLabelStart->setPixmap(iconManager.loadPixmap("paragraph-orphan") ); + keepLabelEnd->setPixmap(iconManager.loadPixmap("paragraph-widow") ); backIcon->setPixmap(iconManager.loadPixmap("16/color-fill.png")); backShadeLabel->setPixmap(iconManager.loadPixmap("shade.png")); + minSpaceLabel->setPixmap(iconManager.loadPixmap("character-space-width-min")); + minGlyphExtLabel->setPixmap(iconManager.loadPixmap("character-scale-width-min")); + maxGlyphExtLabel->setPixmap(iconManager.loadPixmap("character-scale-width-max")); + consecutiveHyphenLabel->setPixmap(iconManager.loadPixmap("hyphen-consecutive")); bulletCharTableButton->setIcon(IconManager::instance().loadPixmap("22/insert-table.png")); + distFromTextLabel->setPixmap(iconManager.loadPixmap("paragraph-list-offset")); + parEffectCharStyleComboLabel->setPixmap(iconManager.loadPixmap("character-style")); } void SMPStyleWidget::languageChange() @@ -122,9 +132,9 @@ int oldLineSpacingModeIndex = lineSpacingMode->currentIndex(); bool lineSpacingModeBlocked = lineSpacingMode->blockSignals(true); lineSpacingMode->clear(); - lineSpacingMode->addItem( tr("Fixed Linespacing")); - lineSpacingMode->addItem( tr("Automatic Linespacing")); - lineSpacingMode->addItem( tr("Align to Baseline Grid")); + lineSpacingMode->addItem( tr("Fixed")); + lineSpacingMode->addItem( tr("Automatic")); + lineSpacingMode->addItem( tr("Baseline")); lineSpacingMode->setCurrentIndex(oldLineSpacingModeIndex); lineSpacingMode->blockSignals(lineSpacingModeBlocked); @@ -241,9 +251,9 @@ m_hasParent = pstyle->hasParent() && parent != nullptr && parent->hasName() && pstyle->parent() != ""; lineSpacingMode->clear(); - lineSpacingMode->addItem( tr("Fixed Linespacing")); - lineSpacingMode->addItem( tr("Automatic Linespacing")); - lineSpacingMode->addItem( tr("Align to Baseline Grid")); + lineSpacingMode->addItem( tr("Fixed")); + lineSpacingMode->addItem( tr("Automatic")); + lineSpacingMode->addItem( tr("Baseline")); // optMarginCombo->clear(); // optMarginCombo->addItem(tr("None"), ParagraphStyle::OM_None); @@ -574,9 +584,9 @@ void SMPStyleWidget::showLineSpacing(const QList<ParagraphStyle*> &pstyles) { lineSpacingMode->clear(); - lineSpacingMode->addItem( tr("Fixed Linespacing")); - lineSpacingMode->addItem( tr("Automatic Linespacing")); - lineSpacingMode->addItem( tr("Align to Baseline Grid")); + lineSpacingMode->addItem( tr("Fixed")); + lineSpacingMode->addItem( tr("Automatic")); + lineSpacingMode->addItem( tr("Baseline")); int tmpLP = -1; for (int i = 0; i < pstyles.count(); ++i) Index: scribus/ui/smpstylewidget.ui =================================================================== --- scribus/ui/smpstylewidget.ui (Revision 26312) +++ scribus/ui/smpstylewidget.ui (Arbeitskopie) @@ -6,11 +6,26 @@ <rect> <x>0</x> <y>0</y> - <width>678</width> - <height>615</height> + <width>550</width> + <height>591</height> </rect> </property> <layout class="QVBoxLayout"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> @@ -23,6 +38,9 @@ <layout class="QVBoxLayout" name="verticalLayout_8"> <item> <layout class="QHBoxLayout"> + <property name="spacing"> + <number>4</number> + </property> <item> <widget class="QLabel" name="parentLabel"> <property name="text"> @@ -50,11 +68,8 @@ </item> <item> <layout class="QGridLayout" name="gridLayout"> - <item row="1" column="1"> - <widget class="QGroupBox" name="advSettingsGroupBox"> - <property name="enabled"> - <bool>true</bool> - </property> + <item row="0" column="0"> + <widget class="QGroupBox" name="distancesBox"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> @@ -61,136 +76,47 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> <property name="title"> - <string>Advanced Settings</string> + <string>Alignment && Distances</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_9"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout_13"> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <property name="spacing"> + <number>16</number> + </property> <item> - <layout class="QVBoxLayout" name="verticalLayout_7"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="minSpaceLabel"> - <property name="text"> - <string>Min. Space Width:</string> - </property> - <property name="buddy"> - <cstring>minSpaceSpin</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMScrSpinBox" name="minSpaceSpin"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="baseSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="toolTip"> - <string>Maximum white space compression allowed. Expressed as a percentage of the current white space value.</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QLabel" name="glyphExtensionLabel"> - <property name="text"> - <string>Glyph Extension </string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLabel" name="minGlyphExtLabel"> - <property name="text"> - <string>Min:</string> - </property> - <property name="buddy"> - <cstring>minGlyphExtSpin</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMScrSpinBox" name="minGlyphExtSpin"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="toolTip"> - <string>Maximum compression of glyphs</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="maxGlyphExtLabel"> - <property name="text"> - <string>Max:</string> - </property> - <property name="buddy"> - <cstring>maxGlyphExtSpin</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMScrSpinBox" name="maxGlyphExtSpin"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="toolTip"> - <string>Maximum extension of glyphs</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QLabel" name="label_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Consecutive Hyphenations Allowed:</string> - </property> - </widget> - </item> - <item> - <widget class="SMSpinBox" name="maxConsecutiveCountSpinBox"/> - </item> - </layout> - </item> - </layout> + <widget class="SMAlignSelect" name="alignment" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> </item> <item> - <spacer name="horizontalSpacer_7"> + <widget class="SMDirectionSelect" name="direction" native="true"/> + </item> + <item> + <spacer name="horizontalSpacer_4"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -202,100 +128,71 @@ </item> </layout> </item> - </layout> - </widget> - </item> - <item row="1" column="0"> - <widget class="QGroupBox" name="opticalMarginsGroupBox"> - <property name="title"> - <string>Optical Margins</string> - </property> - <layout class="QGridLayout" name="gridLayout_3"> - <item row="0" column="0"> - <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <property name="spacing"> + <number>16</number> + </property> <item> - <layout class="QGridLayout" name="gridLayout_5"> - <item row="2" column="0"> - <widget class="SMRadioButton" name="optMarginRadioLeft"> - <property name="text"> - <string>Left Only</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="SMRadioButton" name="optMarginRadioBoth"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Both Sides</string> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="SMRadioButton" name="optMarginRadioNone"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>None</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="SMRadioButton" name="optMarginRadioRight"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Right Only</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QPushButton" name="optMarginDefaultButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Reset to Default</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QPushButton" name="optMarginParentButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Use Parent Value</string> - </property> - </widget> - </item> - </layout> + <widget class="FormWidget" name="lineSpacingLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScComboBox" name="lineSpacingMode"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Line Spacing Mode</string> + </property> + </widget> + </item> + <item> + <widget class="SMScrSpinBox" name="lineSpacing"> + <property name="toolTip"> + <string>Line Spacing</string> + </property> + <property name="minimum"> + <double>1.000000000000000</double> + </property> + <property name="maximum"> + <double>300.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> </item> <item> - <spacer name="horizontalSpacer_15"> + <spacer name="horizontalSpacer_8"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -307,6 +204,113 @@ </item> </layout> </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="spacing"> + <number>16</number> + </property> + <item> + <widget class="FormWidget" name="spaceAboveLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_18"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="spaceAbove"> + <property name="toolTip"> + <string>Space Above</string> + </property> + <property name="maximum"> + <double>300.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="FormWidget" name="spaceBelowLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_19"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="spaceBelow"> + <property name="toolTip"> + <string>Space Below</string> + </property> + <property name="maximum"> + <double>300.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_11"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_3"> + <property name="orientation"> + <enum>Qt::Orientation::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> </layout> </widget> </item> @@ -319,79 +323,113 @@ </sizepolicy> </property> <property name="title"> - <string>Orphans and Widows</string> + <string>Orphans && Widows</string> </property> <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> <layout class="QHBoxLayout" name="horizontalLayout_11"> + <property name="spacing"> + <number>16</number> + </property> <item> - <widget class="QLabel" name="keepLabelStart"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> + <widget class="FormWidget" name="keepLabelStart"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> + <property name="label" stdset="0"> + <string/> </property> - <property name="toolTip"> - <string>Ensure that first lines of a paragraph won't end up separated from the rest (known as widow/orphan control)</string> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_13"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMSpinBox" name="keepLinesStart"> + <property name="toolTip"> + <string>Ensure that first lines of a paragraph won't end up separated from the rest (known as widow/orphan control)</string> + </property> + <property name="suffix"> + <string> lines</string> + </property> + <property name="maximum"> + <number>10</number> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="SMSpinBox" name="keepLinesStart"> - <property name="toolTip"> - <string>Ensure that first lines of a paragraph won't end up separated from the rest (known as widow/orphan control)</string> + <widget class="FormWidget" name="keepLabelEnd"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="suffix"> - <string> lines</string> + <property name="label" stdset="0"> + <string/> </property> - <property name="maximum"> - <number>10</number> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_17"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMSpinBox" name="keepLinesEnd"> + <property name="toolTip"> + <string>Ensure that last lines of a paragraph won't end up separated from the rest (known as widow/orphan control)</string> + </property> + <property name="suffix"> + <string> lines</string> + </property> + <property name="maximum"> + <number>10</number> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="QLabel" name="keepLabelEnd"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="toolTip"> - <string>Ensure that last lines of a paragraph won't end up separated from the rest (known as widow/orphan control)</string> - </property> - </widget> - </item> - <item> - <widget class="SMSpinBox" name="keepLinesEnd"> - <property name="toolTip"> - <string>Ensure that last lines of a paragraph won't end up separated from the rest (known as widow/orphan control)</string> - </property> - <property name="suffix"> - <string> lines</string> - </property> - <property name="maximum"> - <number>10</number> - </property> - </widget> - </item> - <item> <spacer name="horizontalSpacer_6"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -426,7 +464,7 @@ <item> <spacer name="verticalSpacer_4"> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Orientation::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -439,8 +477,11 @@ </layout> </widget> </item> - <item row="0" column="0"> - <widget class="QGroupBox" name="distancesBox"> + <item row="1" column="1"> + <widget class="QGroupBox" name="advSettingsGroupBox"> + <property name="enabled"> + <bool>true</bool> + </property> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> @@ -447,197 +488,191 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> <property name="title"> - <string>Alignment and Distances</string> + <string>Typography</string> </property> - <layout class="QHBoxLayout" name="horizontalLayout_10"> + <layout class="QVBoxLayout" name="verticalLayout_9"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> - <layout class="QVBoxLayout" name="verticalLayout_10"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>4</number> + </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <widget class="SMAlignSelect" name="alignment" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="SMDirectionSelect" name="direction" native="true"/> - </item> - <item> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>0</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <widget class="FormWidget" name="minSpaceLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="minSpaceSpin"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="baseSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Minimal width of spaces between words</string> + </property> + </widget> + </item> + </layout> + </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_9"> - <item> - <widget class="QLabel" name="lineSpacingLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>lineSpacingMode</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMScComboBox" name="lineSpacingMode"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Line Spacing Mode</string> - </property> - </widget> - </item> - <item> - <widget class="SMScrSpinBox" name="lineSpacing"> - <property name="toolTip"> - <string>Line Spacing</string> - </property> - <property name="minimum"> - <double>1.000000000000000</double> - </property> - <property name="maximum"> - <double>300.000000000000000</double> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_8"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>0</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="spacing"> + <number>16</number> + </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <item> - <widget class="QLabel" name="spaceAboveLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>spaceAbove</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMScrSpinBox" name="spaceAbove"> - <property name="toolTip"> - <string>Space Above</string> - </property> - <property name="maximum"> - <double>300.000000000000000</double> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="spaceBelowLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="buddy"> - <cstring>spaceBelow</cstring> - </property> - </widget> - </item> - <item> - <widget class="SMScrSpinBox" name="spaceBelow"> - <property name="toolTip"> - <string>Space Below</string> - </property> - <property name="maximum"> - <double>300.000000000000000</double> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_11"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>0</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + <widget class="FormWidget" name="minGlyphExtLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_14"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="minGlyphExtSpin"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Minimal shrinkage of glyphs for justification</string> + </property> + </widget> + </item> + </layout> + </widget> </item> <item> - <spacer name="verticalSpacer_3"> + <widget class="FormWidget" name="maxGlyphExtLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_16"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="maxGlyphExtSpin"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Maximal extension of glyphs for justification</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>20</width> - <height>0</height> + <width>0</width> + <height>20</height> </size> </property> </spacer> @@ -645,14 +680,14 @@ </layout> </item> <item> - <spacer name="horizontalSpacer_16"> + <spacer name="verticalSpacer_5"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>0</width> - <height>20</height> + <height>0</height> </size> </property> </spacer> @@ -660,117 +695,370 @@ </layout> </widget> </item> - </layout> - </item> - <item> - <widget class="QGroupBox" name="tabsBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Tabs and Indentation</string> - </property> - <layout class="QVBoxLayout"> - <item> - <layout class="QHBoxLayout" name="tabsBoxLayout"> + <item row="2" column="1"> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>Hyphenation</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> - <widget class="SMTabruler" name="tabList" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0,1"> + <item> + <widget class="FormWidget" name="consecutiveHyphenLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_10"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMSpinBox" name="maxConsecutiveCountSpinBox"> + <property name="toolTip"> + <string>Maximum number of Hyphenations following each other. +A value of 0 means unlimited hyphenations.</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item row="1" column="0"> + <widget class="QGroupBox" name="opticalMarginsGroupBox"> + <property name="title"> + <string>Optical Margins</string> + </property> + <layout class="QGridLayout" name="gridLayout_3"> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> + <property name="spacing"> + <number>4</number> + </property> + <item row="2" column="0"> + <widget class="SMRadioButton" name="optMarginRadioLeft"> + <property name="text"> + <string>Left Only</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="SMRadioButton" name="optMarginRadioRight"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="text"> + <string>Right Only</string> + </property> </widget> </item> - <item> - <spacer name="horizontalSpacer_13"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <item row="0" column="1"> + <widget class="QPushButton" name="optMarginDefaultButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>0</width> - <height>20</height> - </size> + <property name="text"> + <string>Reset to Default</string> </property> - </spacer> + </widget> </item> - </layout> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="smColorGroup"> - <property name="title"> - <string>Colors</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <item> - <layout class="QHBoxLayout" name="smColorGroupLayout"> - <item> - <widget class="QLabel" name="backIcon"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> + <item row="0" column="0"> + <widget class="SMRadioButton" name="optMarginRadioNone"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> + <property name="text"> + <string>None</string> </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="SMRadioButton" name="optMarginRadioBoth"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> - <string/> + <string>Both Sides</string> </property> </widget> </item> - <item> - <widget class="SMColorCombo" name="backColor_"> - <property name="toolTip"> - <string>Background Color</string> + <item row="1" column="1"> + <widget class="QPushButton" name="optMarginParentButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> + <property name="text"> + <string>Use Parent Value</string> + </property> </widget> </item> - <item> - <widget class="QLabel" name="backShadeLabel"> - <property name="minimumSize"> + <item row="0" column="2"> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> <size> - <width>20</width> - <height>0</height> + <width>0</width> + <height>20</height> </size> </property> - <property name="maximumSize"> + </spacer> + </item> + <item row="4" column="0"> + <spacer name="verticalSpacer_6"> + <property name="orientation"> + <enum>Qt::Orientation::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> <size> - <width>22</width> - <height>22</height> + <width>0</width> + <height>0</height> </size> </property> - <property name="text"> - <string/> + </spacer> + </item> + </layout> + </widget> + </item> + <item row="2" column="0"> + <widget class="QGroupBox" name="smColorGroup"> + <property name="title"> + <string>Colors</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> + <item> + <layout class="QHBoxLayout" name="smColorGroupLayout"> + <property name="spacing"> + <number>16</number> </property> - </widget> + <item> + <widget class="FormWidget" name="backIcon"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_21"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMColorCombo" name="backColor_"> + <property name="toolTip"> + <string>Background Color</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="FormWidget" name="backShadeLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string/> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_20"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMShadeButton" name="backShade_"> + <property name="toolTip"> + <string>Background Shade</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_12"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> </item> + </layout> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QGroupBox" name="tabsBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Tabs && Indentation</string> + </property> + <layout class="QVBoxLayout"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> + <item> + <layout class="QHBoxLayout" name="tabsBoxLayout"> + <property name="spacing"> + <number>4</number> + </property> <item> - <widget class="SMShadeButton" name="backShade_"> - <property name="toolTip"> - <string>Background Shade</string> + <widget class="SMTabruler" name="tabList" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="text"> - <string/> - </property> </widget> </item> <item> - <spacer name="horizontalSpacer_12"> + <spacer name="horizontalSpacer_13"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -788,7 +1076,7 @@ <item> <spacer name="verticalSpacer"> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Orientation::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -802,7 +1090,7 @@ </widget> <widget class="QWidget" name="tabParagraphEffects"> <attribute name="title"> - <string>Paragraph Effects</string> + <string>Lists && Drop Caps</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_6"> <item> @@ -823,8 +1111,26 @@ <bool>false</bool> </property> <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout_7"> + <layout class="QHBoxLayout" name="horizontalLayout_7" stretch="0,0,0,1"> + <property name="spacing"> + <number>4</number> + </property> <item> <widget class="QLabel" name="bulletCharLabel"> <property name="text"> @@ -852,19 +1158,6 @@ </widget> </item> <item> - <spacer name="spacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> <widget class="QPushButton" name="bulletCharTableButton"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> @@ -886,7 +1179,7 @@ <item> <spacer name="spacer_2"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -919,144 +1212,238 @@ <bool>false</bool> </property> <layout class="QVBoxLayout" name="verticalLayout_5"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="2"> - <spacer name="horizontalSpacer_10"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0,0,0,0,0,0,1"> + <property name="horizontalSpacing"> + <number>4</number> + </property> + <property name="verticalSpacing"> + <number>8</number> + </property> + <item row="1" column="0"> + <widget class="QLabel" name="numFormatLabel"> + <property name="text"> + <string>Style:</string> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> </property> - </spacer> + <property name="buddy"> + <cstring>numFormatCombo</cstring> + </property> + </widget> </item> - <item row="5" column="3" colspan="2"> - <widget class="SMCheckBox" name="numRestartHigherBox"> + <item row="2" column="0"> + <widget class="QLabel" name="numLevelLabel"> <property name="text"> - <string>Restart after higher level</string> + <string>Level:</string> </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> </widget> </item> <item row="2" column="3"> - <widget class="SMSpinBox" name="numStartSpin"> - <property name="maximum"> - <number>99999</number> + <widget class="QLabel" name="numStartLabel"> + <property name="text"> + <string>Start:</string> </property> - <property name="value"> - <number>1</number> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> </property> </widget> </item> - <item row="1" column="1"> - <widget class="SMNumFormatCombo" name="numFormatCombo"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> <item row="0" column="0"> <widget class="QLabel" name="numComboLabel"> <property name="text"> <string>Set:</string> </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> </widget> </item> - <item row="3" column="2"> - <widget class="QLabel" name="numSuffixLabel"> + <item row="4" column="6"> + <widget class="SMCheckBox" name="numRestartOtherBox"> <property name="text"> - <string>Suffix:</string> + <string>Restart after other format</string> </property> </widget> </item> + <item row="3" column="1"> + <widget class="QLineEdit" name="numPrefix"/> + </item> <item row="4" column="0"> <widget class="QLabel" name="numRestartLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> <property name="text"> <string>Restart:</string> </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> </widget> </item> - <item row="2" column="2"> - <widget class="QLabel" name="numStartLabel"> - <property name="text"> - <string>Start with:</string> + <item row="0" column="1" colspan="4"> + <widget class="SMScComboBox" name="numComboBox"> + <property name="currentIndex"> + <number>-1</number> </property> + <property name="minimumContentsLength"> + <number>10</number> + </property> </widget> </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="numPrefix"/> - </item> - <item row="4" column="3" colspan="2"> - <widget class="SMCheckBox" name="numRestartOtherBox"> + <item row="5" column="6"> + <widget class="SMCheckBox" name="numRestartHigherBox"> <property name="text"> - <string>Restart after other format</string> + <string>Restart after higher level</string> </property> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="numFormatLabel"> - <property name="text"> - <string>Numbering Style:</string> + <item row="2" column="2"> + <spacer name="horizontalSpacer_15"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="buddy"> - <cstring>numFormatCombo</cstring> + <property name="sizeType"> + <enum>QSizePolicy::Policy::Fixed</enum> </property> - </widget> + <property name="sizeHint" stdset="0"> + <size> + <width>16</width> + <height>20</height> + </size> + </property> + </spacer> </item> - <item row="0" column="3"> - <widget class="QLabel" name="numNewLabel"> + <item row="3" column="4"> + <widget class="QLineEdit" name="numSuffix"/> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="numPrefixLabel"> <property name="text"> - <string>Create New Set:</string> + <string>Prefix:</string> </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> </widget> </item> - <item row="0" column="1"> - <widget class="SMScComboBox" name="numComboBox"> - <property name="currentIndex"> - <number>-1</number> + <item row="0" column="5"> + <spacer name="horizontalSpacer_17"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> </property> - <property name="minimumContentsLength"> - <number>10</number> + <property name="sizeType"> + <enum>QSizePolicy::Policy::Fixed</enum> </property> + <property name="sizeHint" stdset="0"> + <size> + <width>16</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="1"> + <widget class="SMSpinBox" name="numLevelSpin"/> + </item> + <item row="4" column="1" colspan="4"> + <widget class="SMScComboBox" name="numRestartCombo"/> + </item> + <item row="4" column="7"> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="1" colspan="4"> + <widget class="SMNumFormatCombo" name="numFormatCombo"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> </widget> </item> - <item row="2" column="0"> - <widget class="QLabel" name="numLevelLabel"> - <property name="text"> - <string>Level:</string> + <item row="2" column="4"> + <widget class="SMSpinBox" name="numStartSpin"> + <property name="maximum"> + <number>99999</number> </property> + <property name="value"> + <number>1</number> + </property> </widget> </item> <item row="3" column="3"> - <widget class="QLineEdit" name="numSuffix"/> - </item> - <item row="4" column="1"> - <widget class="SMScComboBox" name="numRestartCombo"/> - </item> - <item row="2" column="1"> - <widget class="SMSpinBox" name="numLevelSpin"/> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="numPrefixLabel"> + <widget class="QLabel" name="numSuffixLabel"> <property name="text"> - <string>Prefix:</string> + <string>Suffix:</string> </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> </widget> </item> - <item row="0" column="4"> - <widget class="QLineEdit" name="numNewLineEdit"/> + <item row="0" column="6"> + <widget class="FormWidget" name="formWidget_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="label" stdset="0"> + <string>New Set:</string> + </property> + <property name="direction"> + <enum>FormWidget::LabelPosition::Left</enum> + </property> + <property name="useSmallFont"> + <bool>false</bool> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_25"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLineEdit" name="numNewLineEdit"/> + </item> + </layout> + </widget> </item> </layout> </item> @@ -1081,6 +1468,21 @@ <bool>true</bool> </property> <layout class="QVBoxLayout" name="_2"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>8</number> + </property> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>8</number> + </property> + <property name="bottomMargin"> + <number>8</number> + </property> <item> <layout class="QHBoxLayout" name="dropCapsBoxLayout"> <item> @@ -1109,7 +1511,7 @@ <item> <spacer name="horizontalSpacer_2"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -1126,72 +1528,127 @@ </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_12"> + <property name="spacing"> + <number>16</number> + </property> <item> - <widget class="QLabel" name="parEffectCharStyleComboLabel"> + <widget class="FormWidget" name="parEffectCharStyleComboLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> - <string>Character Style for Effect:</string> + <property name="label" stdset="0"> + <string>Style</string> </property> + <layout class="QHBoxLayout" name="horizontalLayout_23"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScComboBox" name="parEffectCharStyleCombo"> + <property name="toolTip"> + <string>Choose Character Style or leave blank to use default Paragraph Style</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="SMScComboBox" name="parEffectCharStyleCombo"> - <property name="toolTip"> - <string>Choose Character Style or leave blank to use default Paragraph Style</string> - </property> - </widget> - </item> - <item> - <spacer name="spacer_6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="distFromTextLabel"> + <widget class="FormWidget" name="distFromTextLabel"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> - <string>Distance from Text:</string> + <property name="label" stdset="0"> + <string>Distance</string> </property> - <property name="buddy"> - <cstring>parEffectOffset</cstring> - </property> + <layout class="QHBoxLayout" name="horizontalLayout_22"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMScrSpinBox" name="parEffectOffset"> + <property name="toolTip"> + <string>Paragraph Effects characters offset</string> + </property> + <property name="minimum"> + <double>-3000.000000000000000</double> + </property> + <property name="maximum"> + <double>3000.000000000000000</double> + </property> + </widget> + </item> + </layout> </widget> </item> <item> - <widget class="SMScrSpinBox" name="parEffectOffset"> - <property name="toolTip"> - <string>Paragraph Effects characters offset</string> + <widget class="FormWidget" name="formWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="minimum"> - <double>-3000.000000000000000</double> + <property name="label" stdset="0"> + <string/> </property> - <property name="maximum"> - <double>3000.000000000000000</double> + <property name="preserveLabelSpace"> + <bool>true</bool> </property> + <layout class="QHBoxLayout" name="horizontalLayout_24"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="SMCheckBox" name="parEffectIndentBox"> + <property name="toolTip"> + <string>Hang Paragraph Effect before paragraph indent</string> + </property> + <property name="text"> + <string>Auto-Indent</string> + </property> + </widget> + </item> + </layout> </widget> </item> <item> <spacer name="horizontalSpacer_14"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -1201,24 +1658,17 @@ </property> </spacer> </item> - <item> - <widget class="SMCheckBox" name="parEffectIndentBox"> - <property name="toolTip"> - <string>Hang Paragraph Effect before paragraph indent</string> - </property> - <property name="text"> - <string>Auto-Indent</string> - </property> - </widget> - </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_15"> + <property name="spacing"> + <number>4</number> + </property> <item> <spacer name="spacer_10"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -1243,7 +1693,7 @@ <item> <spacer name="verticalSpacer_2"> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Orientation::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -1286,6 +1736,12 @@ </widget> <customwidgets> <customwidget> + <class>FormWidget</class> + <extends>QWidget</extends> + <header>ui/widgets/form_widget.h</header> + <container>1</container> + </customwidget> + <customwidget> <class>SMScComboBox</class> <extends>QComboBox</extends> <header>ui/smsccombobox.h</header> @@ -1357,6 +1813,8 @@ <tabstop>lineSpacing</tabstop> <tabstop>spaceAbove</tabstop> <tabstop>spaceBelow</tabstop> + <tabstop>keepLinesStart</tabstop> + <tabstop>keepLinesEnd</tabstop> <tabstop>keepTogether</tabstop> <tabstop>keepWithNext</tabstop> <tabstop>optMarginRadioNone</tabstop> @@ -1366,11 +1824,25 @@ <tabstop>optMarginDefaultButton</tabstop> <tabstop>optMarginParentButton</tabstop> <tabstop>minSpaceSpin</tabstop> + <tabstop>minGlyphExtSpin</tabstop> <tabstop>maxGlyphExtSpin</tabstop> + <tabstop>backColor_</tabstop> + <tabstop>backShade_</tabstop> + <tabstop>maxConsecutiveCountSpinBox</tabstop> <tabstop>bulletBox</tabstop> <tabstop>bulletStrEdit</tabstop> <tabstop>bulletCharTableButton</tabstop> <tabstop>numBox</tabstop> + <tabstop>numComboBox</tabstop> + <tabstop>numNewLineEdit</tabstop> + <tabstop>numFormatCombo</tabstop> + <tabstop>numLevelSpin</tabstop> + <tabstop>numStartSpin</tabstop> + <tabstop>numPrefix</tabstop> + <tabstop>numSuffix</tabstop> + <tabstop>numRestartCombo</tabstop> + <tabstop>numRestartOtherBox</tabstop> + <tabstop>numRestartHigherBox</tabstop> <tabstop>dropCapsBox</tabstop> <tabstop>dropCapLines</tabstop> <tabstop>parEffectCharStyleCombo</tabstop> Index: scribus/ui/smtabruler.cpp =================================================================== --- scribus/ui/smtabruler.cpp (Revision 26312) +++ scribus/ui/smtabruler.cpp (Arbeitskopie) @@ -31,20 +31,23 @@ rightIndentSpin = new SMScrSpinBox(0, 4000, this, dEin); Q_CHECK_PTR(rightIndentSpin); - indentLayout->removeWidget(firstLineData); +// indentLayout->rightIndentLabel->removeWidget(firstLineData); firstLineData->hide(); - indentLayout->insertWidget(1, firstLineSpin); - firstLineSpin->show(); + firstLineLabel->addWidget(firstLineSpin); + // indentLayout->insertWidget(1, firstLineSpin); + // firstLineSpin->show(); - indentLayout->removeWidget(leftIndentData); +// indentLayout->removeWidget(leftIndentData); leftIndentData->hide(); - indentLayout->insertWidget(3, leftIndentSpin); - leftIndentSpin->show(); + leftIndentLabel->addWidget(leftIndentSpin); +// indentLayout->insertWidget(3, leftIndentSpin); +// leftIndentSpin->show(); - indentLayout->removeWidget(rightIndentData); +// indentLayout->removeWidget(rightIndentData); rightIndentData->hide(); - indentLayout->insertWidget(5, rightIndentSpin); - rightIndentSpin->show(); + rightIndentLabel->addWidget(rightIndentSpin); +// indentLayout->insertWidget(5, rightIndentSpin); +// rightIndentSpin->show(); connect(firstLineData, SIGNAL(valueChanged(double)), this, SLOT(firstDataChanged())); connect(rightIndentData, SIGNAL(valueChanged(double)), this, SLOT(rightDataChanged())); Index: scribus/ui/storyeditor.cpp =================================================================== --- scribus/ui/storyeditor.cpp (Revision 26312) +++ scribus/ui/storyeditor.cpp (Arbeitskopie) @@ -1289,7 +1289,7 @@ trackingLabel = new QLabel( this ); trackingLabel->setText(""); - trackingLabel->setPixmap(IconManager::instance().loadPixmap("textkern.png")); + trackingLabel->setPixmap(IconManager::instance().loadPixmap("character-letter-tracking")); trackingLabelAction = addWidget(trackingLabel); trackingLabelAction->setVisible(true); @@ -1327,7 +1327,7 @@ void SToolBStyle::iconSetChange() { IconManager& iconManager = IconManager::instance(); - trackingLabel->setPixmap(iconManager.loadPixmap("textkern.png")); + trackingLabel->setPixmap(iconManager.loadPixmap("character-letter-tracking")); } void SToolBStyle::languageChange() @@ -1482,7 +1482,7 @@ sizeAction->setVisible(true); lblScaleTxtH = new QLabel(this); - lblScaleTxtH->setPixmap(IconManager::instance().loadPixmap("textscaleh.png")); + lblScaleTxtH->setPixmap(IconManager::instance().loadPixmap("character-scale-height")); scaleTxtHAction = addWidget(lblScaleTxtH); scaleTxtHAction->setVisible(true); @@ -1494,7 +1494,7 @@ chScaleHAction->setVisible(true); lblScaleTxtV = new QLabel(this); - lblScaleTxtV->setPixmap(IconManager::instance().loadPixmap("textscalev.png")); + lblScaleTxtV->setPixmap(IconManager::instance().loadPixmap("character-scale-width")); scaleTxtVAction = addWidget(lblScaleTxtV); scaleTxtVAction->setVisible(true); @@ -1527,8 +1527,8 @@ void SToolBFont::iconSetChange() { IconManager& iconManager = IconManager::instance(); - lblScaleTxtH->setPixmap(iconManager.loadPixmap("textscaleh.png")); - lblScaleTxtV->setPixmap(iconManager.loadPixmap("textscalev.png")); + lblScaleTxtH->setPixmap(iconManager.loadPixmap("character-scale-height")); + lblScaleTxtV->setPixmap(iconManager.loadPixmap("character-scale-width")); } void SToolBFont::languageChange() Index: scribus/ui/stylemanager.cpp =================================================================== --- scribus/ui/stylemanager.cpp (Revision 26312) +++ scribus/ui/stylemanager.cpp (Arbeitskopie) @@ -201,6 +201,44 @@ okButton->setText(CommonStrings::tr_OK); } +void StyleManager::editStyleByName(int rcType, const QString &name) +{ + m_rcStyle = name; + int i = 0; + + // nitramr: + // We need a better way to find rcType than by ID of top level items. If the order of the root style changes it will break. + // It is better to store an unchangable identifier in StyleViewItem::data(int column, int role). + // https://doc.qt.io/qt-6/qtreewidgetitem.html#data + + QTreeWidgetItemIterator it(styleView); + while (*it) + { + StyleViewItem *item = dynamic_cast<StyleViewItem*>(*it); + if (item) + { + // find rcType by ID + if (item->isRoot()) + { + if (i == rcType) + m_rcType = item->text(0); + ++i; + } + + // double click item with matching style name in right root style + if (item->rootName() == m_rcType && item->text(0) == m_rcStyle) + { + slotDoubleClick(item, 0); + break; + } + + } + ++it; + } + m_rcStyle.clear(); + m_rcType.clear(); +} + void StyleManager::setDoc(ScribusDoc *doc) { ScribusDoc* oldDoc = m_doc; @@ -244,6 +282,58 @@ } } +void StyleManager::showAsNewParagraphStyle() +{ + setPaletteShown(true); + slotNewPopup(m_newPopup->actions().at(0)); +} + +void StyleManager::showAsNewCharacterStyle() +{ + setPaletteShown(true); + slotNewPopup(m_newPopup->actions().at(1)); +} + +void StyleManager::showAsNewLineStyle() +{ + setPaletteShown(true); + slotNewPopup(m_newPopup->actions().at(4)); +} + +void StyleManager::showAsEditCharacterStyle(const QString &name) +{ + if (name.isEmpty()) + return; + + setPaletteShown(true); + + // 1 = top level id of character style in viewStyles list + editStyleByName(1, name); +} + +void StyleManager::showAsEditLineStyle(const QString &name) +{ + if (name.isEmpty()) + return; + + setPaletteShown(true); + + // 4 = top level id of line style in viewStyles list + editStyleByName(4, name); +} + +void StyleManager::showAsEditParagraphStyle(const QString &name) +{ + if (name.isEmpty()) + return; + + setPaletteShown(true); + + // 0 = top level id of paragraph style in viewStyles list + editStyleByName(0, name); + +} + void StyleManager::addStyle(StyleItem *item) { m_items.append(item); Index: scribus/ui/stylemanager.h =================================================================== --- scribus/ui/stylemanager.h (Revision 26312) +++ scribus/ui/stylemanager.h (Arbeitskopie) @@ -31,6 +31,13 @@ void addStyle(StyleItem *item); void updateColorList(); + void showAsNewParagraphStyle(); + void showAsNewCharacterStyle(); + void showAsNewLineStyle(); + void showAsEditParagraphStyle(const QString& name); + void showAsEditCharacterStyle(const QString& name); + void showAsEditLineStyle(const QString& name); + QMap<QString,Keys> keyMap(); public slots: @@ -105,6 +112,8 @@ void setSelection(const QList<QPair<QString, QString> > &selected); void setOkButtonText(); + void editStyleByName(int rcType, const QString &name); + template<class ItemType> ItemType* item(); private slots: Index: scribus/ui/styleselect.cpp =================================================================== --- scribus/ui/styleselect.cpp (Revision 26312) +++ scribus/ui/styleselect.cpp (Arbeitskopie) @@ -14,8 +14,8 @@ StrikeValues::StrikeValues( QWidget* parent ) : QFrame( parent ) { group1Layout = new QGridLayout( this ); - group1Layout->setSpacing(3); - group1Layout->setContentsMargins(3, 3, 3, 3); + group1Layout->setSpacing(4); + group1Layout->setContentsMargins(8, 8, 8, 8); group1Layout->setAlignment( Qt::AlignTop ); LPos = new ScrSpinBox( -0.1, 100, this, 0 ); LPos->setValue( -0.1 ); @@ -47,8 +47,8 @@ UnderlineValues::UnderlineValues( QWidget* parent ) : QFrame( parent ) { group1Layout = new QGridLayout(this); - group1Layout->setSpacing(3); - group1Layout->setContentsMargins(3, 3, 3, 3); + group1Layout->setSpacing(4); + group1Layout->setContentsMargins(8, 8, 8, 8); group1Layout->setAlignment( Qt::AlignTop ); LPos = new ScrSpinBox( -0.1, 100, this, 0 ); LPos->setValue( -0.1 ); @@ -80,8 +80,8 @@ OutlineValues::OutlineValues( QWidget* parent ) : QFrame( parent ) { group1Layout = new QGridLayout( this ); - group1Layout->setSpacing(3); - group1Layout->setContentsMargins(3, 3, 3, 3); + group1Layout->setSpacing(4); + group1Layout->setContentsMargins(8, 8, 8, 8); group1Layout->setAlignment( Qt::AlignTop ); LWidth = new ScrSpinBox( 0, 100, this, 0 ); LWidth->setValue( 1 ); @@ -101,8 +101,8 @@ ShadowValues::ShadowValues( QWidget* parent ) : QFrame( parent ) { group1Layout = new QGridLayout( this ); - group1Layout->setSpacing(3); - group1Layout->setContentsMargins(3, 3, 3, 3); + group1Layout->setSpacing(4); + group1Layout->setContentsMargins(8, 8, 8, 8); group1Layout->setAlignment( Qt::AlignTop ); Xoffset = new ScrSpinBox( -100, 100, this, 0 ); Xoffset->setValue( 5 ); @@ -131,7 +131,7 @@ { IconManager& im = IconManager::instance(); ssLayout = new QHBoxLayout(this); - ssLayout->setSpacing(3); + ssLayout->setSpacing(4); ssLayout->setContentsMargins(0, 0, 0, 0); UnderlineVal = new UnderlineValues( nullptr ); @@ -141,7 +141,6 @@ UnderlinePop->addAction(UnderlineValAct); underlineButton = new QToolButton( this ); underlineButton->setText( "" ); - underlineButton->setIcon(im.loadIcon("unter.png")); underlineButton->setCheckable( true ); underlineButton->setMenu(UnderlinePop); underlineButton->setPopupMode(QToolButton::DelayedPopup); @@ -148,47 +147,45 @@ ssLayout->addWidget( underlineButton ); underlineWordButton = new QToolButton( this ); underlineWordButton->setText( "" ); - underlineWordButton->setIcon(im.loadIcon("wordsOnly.png")); underlineWordButton->setCheckable( true ); underlineWordButton->setMenu(UnderlinePop); underlineWordButton->setPopupMode(QToolButton::DelayedPopup); - ssLayout->addWidget( underlineWordButton ); + ssLayout->addWidget( underlineWordButton ); + StrikeVal = new StrikeValues( nullptr ); + StrikePop = new QMenu(); + StrikeValAct = new QWidgetAction(this); + StrikeValAct->setDefaultWidget(StrikeVal); + StrikePop->addAction(StrikeValAct); + strikeoutButton = new QToolButton( this ); + strikeoutButton->setText( "" ); + strikeoutButton->setCheckable( true ); + strikeoutButton->setMenu(StrikePop); + strikeoutButton->setPopupMode(QToolButton::DelayedPopup); + ssLayout->addWidget( strikeoutButton ); + ssLayout->addSpacing(12); + subscriptButton = new QToolButton( this ); subscriptButton->setText( "" ); - subscriptButton->setIcon(im.loadIcon("tief.png")); subscriptButton->setCheckable( true ); ssLayout->addWidget( subscriptButton ); superscriptButton = new QToolButton( this ); superscriptButton->setText( "" ); - superscriptButton->setIcon(im.loadIcon("hoch.png")); superscriptButton->setCheckable( true ); ssLayout->addWidget( superscriptButton ); + ssLayout->addSpacing(12); + allcapsButton = new QToolButton( this ); - allcapsButton->setMaximumSize( QSize( 22, 22 ) ); allcapsButton->setText(""); - allcapsButton->setIcon(im.loadIcon("AllCaps.png")); allcapsButton->setCheckable( true ); ssLayout->addWidget( allcapsButton ); smallcapsButton = new QToolButton( this ); smallcapsButton->setText(""); - smallcapsButton->setIcon(im.loadIcon("kapital.png")); smallcapsButton->setCheckable( true ); ssLayout->addWidget( smallcapsButton ); - StrikeVal = new StrikeValues( nullptr ); - StrikePop = new QMenu(); - StrikeValAct = new QWidgetAction(this); - StrikeValAct->setDefaultWidget(StrikeVal); - StrikePop->addAction(StrikeValAct); - strikeoutButton = new QToolButton( this ); - strikeoutButton->setText( "" ); - strikeoutButton->setIcon(im.loadIcon("strike.png")); - strikeoutButton->setCheckable( true ); - strikeoutButton->setMenu(StrikePop); - strikeoutButton->setPopupMode(QToolButton::DelayedPopup); - ssLayout->addWidget( strikeoutButton ); + ssLayout->addSpacing(12); OutlineVal = new OutlineValues( nullptr ); OutlinePop = new QMenu(); @@ -197,7 +194,6 @@ OutlinePop->addAction(OutlineValAct); outlineButton = new QToolButton( this ); outlineButton->setText( "" ); - outlineButton->setIcon(im.loadIcon("outlined.png")); outlineButton->setCheckable( true ); outlineButton->setMenu(OutlinePop); outlineButton->setPopupMode(QToolButton::DelayedPopup); @@ -210,33 +206,13 @@ ShadowPop->addAction(ShadowValAct); shadowButton = new QToolButton( this ); shadowButton->setText( "" ); - shadowButton->setIcon(im.loadIcon("shadow.png")); shadowButton->setCheckable( true ); shadowButton->setMenu(ShadowPop); shadowButton->setPopupMode(QToolButton::DelayedPopup); ssLayout->addWidget( shadowButton ); - - QSize s(24,24); - underlineButton->setMinimumSize(s); - underlineWordButton->setMinimumSize(s); - subscriptButton->setMinimumSize(s); - superscriptButton->setMinimumSize(s); - smallcapsButton->setMinimumSize(s); - allcapsButton->setMinimumSize(s); - strikeoutButton->setMinimumSize(s); - outlineButton->setMinimumSize(s); - shadowButton->setMinimumSize(s); - underlineButton->setMaximumSize(s); - underlineWordButton->setMaximumSize(s); - subscriptButton->setMaximumSize(s); - superscriptButton->setMaximumSize(s); - smallcapsButton->setMaximumSize(s); - allcapsButton->setMaximumSize(s); - strikeoutButton->setMaximumSize(s); - outlineButton->setMaximumSize(s); - shadowButton->setMaximumSize(s); languageChange(); + iconSetChange(); connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); @@ -267,35 +243,16 @@ { IconManager& im = IconManager::instance(); - underlineButton->setIcon(im.loadIcon("unter.png")); - underlineWordButton->setIcon(im.loadIcon("wordsOnly.png")); - subscriptButton->setIcon(im.loadIcon("tief.png")); - superscriptButton->setIcon(im.loadIcon("hoch.png")); - allcapsButton->setIcon(im.loadIcon("AllCaps.png")); - smallcapsButton->setIcon(im.loadIcon("kapital.png")); - strikeoutButton->setIcon(im.loadIcon("strike.png")); - outlineButton->setIcon(im.loadIcon("outlined.png")); - shadowButton->setIcon(im.loadIcon("shadow.png")); - - QSize s(24,24); - underlineButton->setMinimumSize(s); - underlineWordButton->setMinimumSize(s); - subscriptButton->setMinimumSize(s); - superscriptButton->setMinimumSize(s); - smallcapsButton->setMinimumSize(s); - allcapsButton->setMinimumSize(s); - strikeoutButton->setMinimumSize(s); - outlineButton->setMinimumSize(s); - shadowButton->setMinimumSize(s); - underlineButton->setMaximumSize(s); - underlineWordButton->setMaximumSize(s); - subscriptButton->setMaximumSize(s); - superscriptButton->setMaximumSize(s); - smallcapsButton->setMaximumSize(s); - allcapsButton->setMaximumSize(s); - strikeoutButton->setMaximumSize(s); - outlineButton->setMaximumSize(s); - shadowButton->setMaximumSize(s); + underlineButton->setIcon(im.loadIcon("character-underline")); + underlineWordButton->setIcon(im.loadIcon("character-underline-word")); + subscriptButton->setIcon(im.loadIcon("character-subscript")); + superscriptButton->setIcon(im.loadIcon("character-superscript")); + allcapsButton->setIcon(im.loadIcon("character-capitals-all")); + smallcapsButton->setIcon(im.loadIcon("character-capitals-small")); + strikeoutButton->setIcon(im.loadIcon("character-strikethrough")); + outlineButton->setIcon(im.loadIcon("character-outline")); + shadowButton->setIcon(im.loadIcon("character-shadow")); + } void StyleSelect::languageChange() @@ -305,22 +262,12 @@ UnderlineVal->languageChange(); StrikeVal->languageChange(); - underlineButton->setToolTip(""); - underlineWordButton->setToolTip(""); - allcapsButton->setToolTip(""); - smallcapsButton->setToolTip(""); - subscriptButton->setToolTip(""); - superscriptButton->setToolTip(""); - strikeoutButton->setToolTip(""); - outlineButton->setToolTip(""); - shadowButton->setToolTip(""); - - underlineButton->setToolTip( "<qt>" + tr("Underline Text. Hold down the button momentarily to set line width and displacement options.")); + underlineButton->setToolTip( "<qt>" + tr("Underline Text. Hold down the button momentarily to set line width and displacement options.") + "</qt>"); underlineWordButton->setToolTip( "<qt>" + tr("Underline Words Only. Hold down the button momentarily to set line width and displacement options.") + "</qt>" ); - allcapsButton->setToolTip( tr("All Caps")); - smallcapsButton->setToolTip( tr("Small Caps")); - subscriptButton->setToolTip( tr("Subscript")); - superscriptButton->setToolTip( tr("Superscript")); + allcapsButton->setToolTip( "<qt>" + tr("All Caps") + "</qt>"); + smallcapsButton->setToolTip( "<qt>" + tr("Fake Small Caps") + "</qt>"); + subscriptButton->setToolTip( "<qt>" + tr("Subscript") + "</qt>"); + superscriptButton->setToolTip( "<qt>" + tr("Superscript") + "</qt>"); strikeoutButton->setToolTip( "<qt>" + tr("Strike Out. Hold down the button momentarily to set line width and displacement options.") + "</qt>" ); outlineButton->setToolTip( "<qt>" + tr("Outline. Hold down the button momentarily to change the outline stroke width.") + "</qt>" ); shadowButton->setToolTip( "<qt>" + tr("Shadowed Text. Hold down the button momentarily to change the shadow offset values.") + "</qt>" ); Index: scribus/ui/tabruler.cpp =================================================================== --- scribus/ui/tabruler.cpp (Revision 26312) +++ scribus/ui/tabruler.cpp (Arbeitskopie) @@ -479,6 +479,7 @@ Tabruler::Tabruler( QWidget* parent, bool haveFirst, int unit, const QList<ParagraphStyle::TabRecord>& tabs, double wid ): QWidget( parent ) { + m_haveFirst = haveFirst; m_docUnitRatio = unitGetRatioFromIndex(unit); double ww = (wid < 0) ? 4000 : wid; tabrulerLayout = new QVBoxLayout( this ); @@ -502,70 +503,67 @@ layout1 = new QHBoxLayout; layout1->setContentsMargins(0, 0, 0, 0); - layout1->setSpacing(6); + layout1->setSpacing(16); layout1->setAlignment( Qt::AlignTop ); typeCombo = new QComboBox(this); typeCombo->setEditable(false); - typeCombo->clear(); - typeCombo->addItem( tr( "Left" ) ); - typeCombo->addItem( tr( "Right" ) ); - typeCombo->addItem( tr( "Period" ) ); - typeCombo->addItem( tr( "Comma" ) ); - typeCombo->addItem( tr( "Center" ) ); layout1->addWidget( typeCombo ); + tabData = new ScrSpinBox( 0, ww / m_docUnitRatio, this, unit ); tabData->setValue(0); - positionLabel = new QLabel( tr("&Position:"), this ); - positionLabel->setBuddy(tabData); + positionLabel = new FormWidget(); + positionLabel->setDirection(FormWidget::Left); + positionLabel->setUseSmallFont(false); + positionLabel->addWidget(tabData); layout1->addWidget( positionLabel ); - layout1->addWidget( tabData ); + tabFillCombo = new QComboBox(this); tabFillCombo->setEditable(false); - tabFillCombo->addItem( tr("None", "tab fill")); - tabFillCombo->addItem( tr("Dot")); - tabFillCombo->addItem( tr("Hyphen")); - tabFillCombo->addItem( tr("Underscore")); - tabFillCombo->addItem( tr("Custom")); - tabFillComboT = new QLabel( tr( "Fill Char:" ), this ); - tabFillComboT->setBuddy(tabFillCombo); + tabFillComboT = new FormWidget(); + tabFillComboT->setDirection(FormWidget::Left); + tabFillComboT->setUseSmallFont(false); + tabFillComboT->addWidget(tabFillCombo); layout1->addWidget( tabFillComboT ); - layout1->addWidget( tabFillCombo ); + clearOneButton = new QToolButton( this ); - clearOneButton->setIcon(IconManager::instance().loadIcon("16/edit-delete.png")); - layout1->addSpacing(12); - layout1->addWidget(clearOneButton); + clearButton = new QToolButton( this ); - clearButton->setIcon(IconManager::instance().loadIcon("16/edit-delete-all.png")); - layout1->addWidget(clearButton); + FormWidget *clearLayout = new FormWidget(); + clearLayout->setSpace(4); + clearLayout->setLabelVisibility(false); + clearLayout->addWidget(clearOneButton); + clearLayout->addWidget(clearButton); + layout1->addWidget(clearLayout); + indentLayout = new QHBoxLayout; indentLayout->setContentsMargins(0, 0, 0, 0); - indentLayout->setSpacing(6); - if (haveFirst) + indentLayout->setSpacing(16); + if (m_haveFirst) { firstLineData = new ScrSpinBox( -3000, ww / m_docUnitRatio, this, unit); firstLineData->setValue(0); - firstLineLabel = new QLabel(this); + firstLineLabel = new FormWidget(this); firstLineLabel->setText(""); - firstLineLabel->setPixmap(IconManager::instance().loadPixmap("firstline.png")); + firstLineLabel->addWidget(firstLineData); indentLayout->addWidget( firstLineLabel ); - indentLayout->addWidget( firstLineData ); + leftIndentData = new ScrSpinBox( 0, ww / m_docUnitRatio, this, unit); leftIndentData->setValue(0); - leftIndentLabel = new QLabel(this); + leftIndentLabel = new FormWidget(this); leftIndentLabel->setText(""); - leftIndentLabel->setPixmap(IconManager::instance().loadPixmap("leftindent.png")); + leftIndentLabel->addWidget(leftIndentData); indentLayout->addWidget(leftIndentLabel); - indentLayout->addWidget(leftIndentData); - rightIndentLabel = new QLabel(this); - rightIndentLabel->setText(""); - rightIndentLabel->setPixmap(IconManager::instance().loadPixmap("rightindent.png")); + rightIndentData = new ScrSpinBox(0, ww / m_docUnitRatio, this, unit); rightIndentData->setValue(0); + rightIndentLabel = new FormWidget(this); + rightIndentLabel->setText(""); + rightIndentLabel->addWidget(rightIndentData); indentLayout->addWidget(rightIndentLabel); - indentLayout->addWidget(rightIndentData); + } - if (!haveFirst) + if (!m_haveFirst) { auto* spacer = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); layout1->addItem(spacer); @@ -585,6 +583,9 @@ clearOneButton->setEnabled(false); resize( minimumSizeHint() ); + iconSetChange(); + languageChange(); + connect(rulerScrollL, SIGNAL(clicked()), ruler, SLOT(decreaseOffset())); connect(rulerScrollR, SIGNAL(clicked()), ruler, SLOT(increaseOffset())); connect(rulerScrollL, SIGNAL(released()), this, SLOT(resetOFfL())); @@ -602,11 +603,7 @@ connect(clearButton, SIGNAL(clicked()), this, SLOT(clearAll())); connect(clearOneButton, SIGNAL(clicked()), this, SLOT(clearOne())); - tabFillCombo->setToolTip( tr( "Fill Character of Tab" ) ); - typeCombo->setToolTip( tr( "Type/Orientation of Tab" ) ); - tabData->setToolTip( tr( "Position of Tab" ) ); - - if (haveFirst) + if (m_haveFirst) { connect(ruler, SIGNAL(firstLineMoved(double)) , this, SLOT(setFirstLineData(double))); connect(ruler, SIGNAL(leftIndentMoved(double)) , this, SLOT(setLeftIndentData(double))); @@ -615,19 +612,11 @@ connect(firstLineData, SIGNAL(valueChanged(double)), this, SLOT(setFirstLine())); connect(leftIndentData, SIGNAL(valueChanged(double)), this, SLOT(setLeftIndent())); connect(rightIndentData, SIGNAL(valueChanged(double)), this, SLOT(setRightIndent())); - firstLineData->setToolTip( tr( "Indentation for first line of the paragraph" ) ); - leftIndentData->setToolTip( tr( "Indentation from the left for the whole paragraph" ) ); - rightIndentData->setToolTip( tr( "Indentation from the right for the whole paragraph" ) ); - firstLineLabel->setToolTip(firstLineData->toolTip()); - leftIndentLabel->setToolTip(leftIndentData->toolTip()); - rightIndentLabel->setToolTip(rightIndentData->toolTip()); } - clearButton->setToolTip( tr( "Delete all Tabulators" ) ); - clearOneButton->setToolTip( tr("Delete selected Tabulator")); if (unit == SC_INCHES) { - if (haveFirst) + if (m_haveFirst) { firstLineData->setDecimals(4); leftIndentData->setDecimals(4); @@ -635,7 +624,6 @@ } tabData->setDecimals(4); } - m_haveFirst = haveFirst; connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); } @@ -655,16 +643,16 @@ IconManager& iconManager = IconManager::instance(); if (firstLineLabel) - firstLineLabel->setPixmap(iconManager.loadPixmap("firstline.png")); + firstLineLabel->setPixmap(iconManager.loadPixmap("paragraph-indent-firstline")); if (leftIndentLabel) - leftIndentLabel->setPixmap(iconManager.loadPixmap("leftindent.png")); + leftIndentLabel->setPixmap(iconManager.loadPixmap("paragraph-indent-left")); if (rightIndentLabel) - rightIndentLabel->setPixmap(iconManager.loadPixmap("rightindent.png")); + rightIndentLabel->setPixmap(iconManager.loadPixmap("paragraph-indent-right")); - clearOneButton->setIcon(iconManager.loadIcon("16/edit-delete.png")); - clearButton->setIcon(iconManager.loadIcon("16/edit-delete-all.png")); + clearOneButton->setIcon(iconManager.loadIcon("delete-selected")); + clearButton->setIcon(iconManager.loadIcon("16/edit-delete.png")); } void Tabruler::languageChange() @@ -695,8 +683,8 @@ tabFillComboT->setText( tr( "Fill Char:" )); - clearButton->setText( tr( "Delete All" ) ); - clearOneButton->setText( tr( "Delete Selected" ) ); + clearButton->setToolTip( tr( "Delete all Tabulators" ) ); + clearOneButton->setToolTip( tr("Delete selected Tabulator")); tabFillCombo->setToolTip( tr( "Fill Character of Tab" ) ); typeCombo->setToolTip( tr( "Type/Orientation of Tab" ) ); @@ -711,8 +699,6 @@ leftIndentLabel->setToolTip(leftIndentData->toolTip()); rightIndentLabel->setToolTip(rightIndentData->toolTip()); } - clearButton->setToolTip( tr( "Delete all Tabulators" ) ); - clearOneButton->setToolTip( tr("Delete selected Tabulator")); QString unitSuffix = unitGetSuffixFromIndex(tabData->unitIndex()); if (m_haveFirst) Index: scribus/ui/tabruler.h =================================================================== --- scribus/ui/tabruler.h (Revision 26312) +++ scribus/ui/tabruler.h (Arbeitskopie) @@ -19,6 +19,7 @@ #include "scribusapi.h" #include "sctextstruct.h" +#include "ui/widgets/form_widget.h" class QComboBox; class QPushButton; @@ -145,14 +146,14 @@ QHBoxLayout* indentLayout { nullptr }; QComboBox* typeCombo { nullptr }; QComboBox* tabFillCombo { nullptr }; - QLabel* tabFillComboT { nullptr }; + FormWidget* tabFillComboT { nullptr }; RulerT* ruler { nullptr }; QToolButton* rulerScrollL { nullptr }; QToolButton* rulerScrollR { nullptr }; - QLabel* positionLabel { nullptr }; - QLabel* firstLineLabel { nullptr }; - QLabel* leftIndentLabel { nullptr }; - QLabel* rightIndentLabel { nullptr }; + FormWidget* positionLabel { nullptr }; + FormWidget* firstLineLabel { nullptr }; + FormWidget* leftIndentLabel { nullptr }; + FormWidget* rightIndentLabel { nullptr }; ScrSpinBox* tabData { nullptr }; ScrSpinBox* firstLineData { nullptr }; ScrSpinBox* leftIndentData { nullptr }; Index: scribus/ui/widgets/form_widget.cpp =================================================================== --- scribus/ui/widgets/form_widget.cpp (Revision 26312) +++ scribus/ui/widgets/form_widget.cpp (Arbeitskopie) @@ -12,11 +12,9 @@ FormWidget::FormWidget(QWidget *parent) : QWidget(parent) { - QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Minimum); m_font = this->font(); - m_devicePixelRatio = qApp->devicePixelRatio(); - setSizePolicy(policy); + setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); calculateFrame(); } @@ -29,8 +27,13 @@ QSize FormWidget::minimumSizeHint() const { - int w = 0, h = 0; - labelSize(w,h); + int l = 0; + int t = 0; + int r = 0; + int b = 0; + int w = 0; + int h = 0; + labelSize(l, t, r, b, w, h); return QSize(w, h).expandedTo(QWidget::minimumSizeHint()); } @@ -43,26 +46,15 @@ void FormWidget::calculateFrame() { + int l = 0; + int t = 0; + int r = 0; + int b = 0; + int w = 0; + int h = 0; + labelSize(l, t, r, b, w, h); + setContentsMargins(l, t, r, b); - int w, h; - labelSize(w,h); - - switch (m_position) - { - case Left: - setContentsMargins(w, 0, 0, 0); - break; - case Right: - setContentsMargins(0, 0, w, 0); - break; - case Top: - setContentsMargins(0, h, 0, 0); - break; - case Bottom: - setContentsMargins(0, 0, 0, h); - break; - } - update(); } @@ -71,7 +63,7 @@ m_shortcutId = 0; m_hasShortcut = false; - if (hasPixmap() || m_label.isEmpty() || m_labelVisibility == false) + if (m_label.isEmpty() || m_labelVisibility == false) return; if (!m_label.contains(QLatin1Char('&'))) @@ -93,7 +85,7 @@ { QWidget::paintEvent(e); - if (!labelVisibility()) return; + if (!labelVisibility() && !iconVisibility()) return; QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing, true); @@ -111,67 +103,85 @@ painter.setPen(pen); painter.setFont(tmpFont); - QRect r = rect(); + QRect rLabel = rect(); + QRect rIcon = rect(); QPixmap pix = m_pixmap; + pix.setDevicePixelRatio(devicePixelRatio()); + QRect rWidgets = contentsRect(); - if (hasPixmap() && pix.size() != m_pixmapSize) - pix = pix.scaled(m_pixmapSize * m_devicePixelRatio, Qt::KeepAspectRatio, Qt::SmoothTransformation); + // painter.setBrush(Qt::NoBrush); + // painter.setPen(Qt::magenta); + // painter.drawRect(rect()); + // painter.setPen(Qt::blue); + // painter.drawRect(rWidgets); + if (canUsePixmap() && pix.size() != m_pixmapSize) + pix = pix.scaled(m_pixmapSize * devicePixelRatio(), Qt::KeepAspectRatio, Qt::SmoothTransformation); + if (!isEnabled()) pix = style->generatedIconPixmap(QIcon::Disabled, pix, &opt); + if (canUsePixmap()) + { + rIcon = QRect(0, 0, m_pixmap.deviceIndependentSize().width(), m_pixmap.deviceIndependentSize().height()); + rIcon.moveCenter(rWidgets.center()); - switch (m_position){ - case Left: - if (hasPixmap()) - { - r= QRect (0, (height() - m_pixmap.height()) / 2, m_pixmap.width(), m_pixmap.height()); - style->drawItemPixmap(&painter, r, align, pix); - + switch (m_iconPosition){ + default: + case Left: + rIcon.moveLeft(0); + rLabel = rLabel.adjusted(rIcon.width() + m_space, 0, 0, 0); + break; + case Right: + rIcon.moveRight(width()); + rLabel = rLabel.adjusted(0, 0, -rIcon.width() - m_space, 0); + break; + case Top: + rIcon.moveTop(0); + rLabel = rLabel.adjusted(0, rIcon.height() + m_space, 0, 0); + break; + case Bottom: + rIcon.moveBottom(height()); + rLabel = rLabel.adjusted(0, 0, 0, -rIcon.height() - m_space); + break; } - else - style->drawItemText(&painter, r, Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, opt.palette, isEnabled(), m_label, foregroundRole()); - break; - case Right: - if (hasPixmap()) - { - r= QRect (width() - m_pixmap.width(), (height() - m_pixmap.height()) / 2, m_pixmap.width(), m_pixmap.height()); - style->drawItemPixmap(&painter, r, align, pix); - } - else - style->drawItemText(&painter, r, Qt::AlignRight | Qt::AlignVCenter | Qt::TextShowMnemonic, opt.palette, isEnabled(), m_label, foregroundRole()); + style->drawItemPixmap(&painter, rIcon, align, pix); - break; - case Top: - if (hasPixmap()) - { - r= QRect ((width() - m_pixmap.width()) / 2, 0, m_pixmap.width(), m_pixmap.height()); - style->drawItemPixmap(&painter, r, align, pix); - } - else - style->drawItemText(&painter, r, Qt::AlignHCenter | Qt::AlignTop | Qt::TextShowMnemonic, opt.palette, isEnabled(), m_label, foregroundRole()); + // painter.setBrush(Qt::NoBrush); + // painter.setPen(Qt::red); + // painter.drawRect(rIcon); + } - break; - case Bottom: - if (hasPixmap()) - { - r= QRect ((width() - m_pixmap.width()) / 2, height() - m_pixmap.height(), m_pixmap.width(), m_pixmap.height()); - style->drawItemPixmap(&painter, r, align, pix); + if (canUseLabel()) + { + switch (m_position){ + case Left: + style->drawItemText(&painter, rLabel, Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, opt.palette, isEnabled(), m_label, foregroundRole()); + break; + case Right: + style->drawItemText(&painter, rLabel, Qt::AlignRight | Qt::AlignVCenter | Qt::TextShowMnemonic, opt.palette, isEnabled(), m_label, foregroundRole()); + break; + case Top: + style->drawItemText(&painter, rLabel, Qt::AlignHCenter | Qt::AlignTop | Qt::TextShowMnemonic, opt.palette, isEnabled(), m_label, foregroundRole()); + break; + case Bottom: + style->drawItemText(&painter, rLabel, Qt::AlignHCenter | Qt::AlignBottom | Qt::TextShowMnemonic, opt.palette, isEnabled(), m_label, foregroundRole()); + break; } - else - style->drawItemText(&painter, r, Qt::AlignHCenter | Qt::AlignBottom | Qt::TextShowMnemonic, opt.palette, isEnabled(), m_label, foregroundRole()); - break; + // painter.setBrush(Qt::NoBrush); + // painter.setPen(Qt::green); + // painter.drawRect(rLabel); } } bool FormWidget::event(QEvent *e) -{ - QEvent::Type type = e->type(); +{ #ifndef EXCLUDE_FOR_DESIGNER_PLUGIN + QEvent::Type type = e->type(); if (type == QEvent::Shortcut && this->layout()->count() > 0) { QShortcutEvent *se = static_cast<QShortcutEvent *>(e); if (se->shortcutId() == m_shortcutId) { @@ -243,53 +253,89 @@ * ********************************************************************************* */ -void FormWidget::labelSize(int &w, int &h) const +void FormWidget::labelSize(int &l, int &t, int &r, int &b, int &w, int &h) const { + l = 0; + t = 0; + r = 0; + b = 0; w = 0; h = 0; - if (hasPixmap()) + if (canUsePixmap()) { - w = m_pixmapSize.width() * m_devicePixelRatio + m_space; - h = m_pixmapSize.height() * m_devicePixelRatio + m_space; - } - else - { + int iconWidth = m_pixmapSize.width() + m_space; + int iconHeight = m_pixmapSize.height() + m_space; - if ((m_label.isEmpty() && m_preserveLabelSpace == false) || m_labelVisibility == false) + w += iconWidth; + h += iconHeight; + + switch (m_iconPosition) { - w = 0; - h = 0; + case Left: + l += iconWidth; + break; + case Right: + r += iconWidth; + break; + case Top: + t += iconHeight; + break; + case Bottom: + b += iconHeight; + break; } - else - { - QFont tmpFont(m_font); - if (m_useSmallFont) - tmpFont.setPointSize(smallFontSize()); - QFontMetrics metrics(tmpFont); - QString label = m_label; + } - // calculate width without hidden "&" - if (m_hasShortcut) + if (canUseLabel()) + { + QFont tmpFont(m_font); + if (m_useSmallFont) + tmpFont.setPointSize(smallFontSize()); + + QFontMetrics metrics(tmpFont); + QString label = m_label; + + // calculate width without hidden "&" + if (m_hasShortcut) + { + int pos = 0; + while ( pos < m_label.size()) { - int pos = 0; - while ( pos < m_label.size()) - { - int index = label.indexOf(QLatin1String("&"), pos); + int index = label.indexOf(QLatin1String("&"), pos); - if (pos == index) - label = label.replace(index, 1, ""); + if (pos == index) + label = label.replace(index, 1, ""); - pos++; - } + pos++; } + } - w = metrics.horizontalAdvance(label) + metrics.horizontalAdvance(QLatin1Char(' ')) + m_space; - h = metrics.height() + m_space; + int labelWidth = metrics.horizontalAdvance(label) + metrics.horizontalAdvance(QLatin1Char(' ')) + m_space; + int labelHeight = metrics.height() + m_space; + w += labelWidth; + h += labelHeight; + + switch (m_position) + { + case Left: + l += labelWidth; + break; + case Right: + r += labelWidth; + break; + case Top: + t += labelHeight; + break; + case Bottom: + b += labelHeight; + break; } + } + } int FormWidget::smallFontSize() const @@ -338,6 +384,12 @@ calculateFrame(); } +void FormWidget::setIconDirection(LabelPosition direction) +{ + m_iconPosition = direction; + calculateFrame(); +} + void FormWidget::setFont(QFont font) { m_font = font; @@ -359,7 +411,6 @@ void FormWidget::setPixmap(QPixmap icon) { m_pixmap = icon; - updateShortcut(); calculateFrame(); } @@ -370,6 +421,12 @@ calculateFrame(); } +void FormWidget::setIconVisibility(bool visible) +{ + m_iconVisibility = visible; + calculateFrame(); +} + void FormWidget::addWidget(QWidget* widget) { if (layout() != nullptr) Index: scribus/ui/widgets/form_widget.h =================================================================== --- scribus/ui/widgets/form_widget.h (Revision 26312) +++ scribus/ui/widgets/form_widget.h (Arbeitskopie) @@ -15,17 +15,19 @@ class FormWidget : public QWidget { Q_OBJECT - Q_CLASSINFO("Version", "1.1.0") + Q_CLASSINFO("Version", "1.2.0") Q_PROPERTY(QString label READ text WRITE setText) Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap) Q_PROPERTY(QSize pixmapSize READ pixmapSize WRITE setPixmapSize) Q_PROPERTY(LabelPosition direction READ direction WRITE setDirection) + Q_PROPERTY(LabelPosition iconDirection READ iconDirection WRITE setIconDirection) Q_PROPERTY(QFont font READ font WRITE setFont STORED true) Q_PROPERTY(bool useSmallFont READ useSmallFont WRITE setUseSmallFont) Q_PROPERTY(int space READ space WRITE setSpace) Q_PROPERTY(bool preserveLabelSpace READ preserveLabelSpace WRITE setPreserveLabelSpace) Q_PROPERTY(bool labelVisibility READ labelVisibility WRITE setLabelVisibility) + Q_PROPERTY(bool iconVisibility READ iconVisibility WRITE setIconVisibility) public: @@ -43,6 +45,9 @@ void setLabelVisibility(bool visible); bool labelVisibility() { return m_labelVisibility; }; + void setIconVisibility(bool visible); + bool iconVisibility() const { return m_iconVisibility; }; + void setPreserveLabelSpace(bool preserveSpace); bool preserveLabelSpace() { return m_preserveLabelSpace; }; @@ -49,6 +54,9 @@ void setDirection(FormWidget::LabelPosition direction); FormWidget::LabelPosition direction() { return m_position; }; + void setIconDirection(FormWidget::LabelPosition direction); + FormWidget::LabelPosition iconDirection() { return m_iconPosition; }; + void setFont(QFont font); QFont font() { return m_font; }; @@ -66,7 +74,8 @@ void setPixmapSize(QSize size); QSize pixmapSize() { return m_pixmapSize; }; - bool hasPixmap() const { return !m_pixmap.isNull(); }; + bool canUsePixmap() const { return (!m_pixmap.isNull() && m_iconVisibility); }; + bool canUseLabel() const { return (!m_label.isEmpty() && m_labelVisibility) || (m_preserveLabelSpace && m_labelVisibility); }; void addWidget(QWidget* widget); @@ -76,21 +85,22 @@ private: LabelPosition m_position {LabelPosition::Bottom}; + LabelPosition m_iconPosition {LabelPosition::Left}; int m_space {4}; QSize m_pixmapSize {QSize(16,16)}; QString m_label {"Label"}; QFont m_font; QPixmap m_pixmap {QPixmap()}; + bool m_iconVisibility {true}; bool m_preserveLabelSpace {false}; bool m_labelVisibility {true}; bool m_hasShortcut {false}; int m_shortcutId {0}; - qreal m_devicePixelRatio {1.0}; bool m_useSmallFont {true}; void calculateFrame(); void updateShortcut(); - void labelSize(int &w, int &h) const; + void labelSize(int &l, int &t, int &r, int &b, int &w, int &h) const; }; Index: scribus/ui/widgets/section_container.cpp =================================================================== --- scribus/ui/widgets/section_container.cpp (Revision 26312) +++ scribus/ui/widgets/section_container.cpp (Arbeitskopie) @@ -109,6 +109,57 @@ return m_hasStyle; } +void SectionContainer::setHeaderType(SectionContainerHeader::HeaderType type) +{ + header->m_headerType = type; + + QFont fnt = font(); + + if (type == SectionContainerHeader::Header) + fnt.setBold(true); + + header->labelTitle->setFont(fnt); + + update(); +} + +SectionContainerHeader::HeaderType SectionContainer::headerType() const +{ + return header->m_headerType; +} + +void SectionContainer::setHeaderSize(SectionContainerHeader::HeaderSize size) +{ + int pt = 4; + int pb = 4; + + switch (size) + { + case SectionContainerHeader::Large: + pt = 8; + pb = 4; + + break; + case SectionContainerHeader::Condensed: + pt = 2; + pb = 2; + break; + default: + case SectionContainerHeader::Normal: + break; + } + + header->m_headerSize = size; + header->layoutHeader->setContentsMargins(4, pt, 4, pb); + header->setFixedHeight(header->buttonCollapse->height() + pt + pb); + +} + +SectionContainerHeader::HeaderSize SectionContainer::headerSize() const +{ + return header->m_headerSize; +} + void SectionContainer::setCanSaveState(bool saveState) { m_canSaveState = saveState; @@ -375,13 +426,13 @@ return; int lineWidth = 1; - QColor bottomLineColor(palette().color(QPalette::Dark)); + QColor bottomLineColor(palette().color(QPalette::Mid)); QPainter painter(this); // Bottom Line painter.setPen(QPen(bottomLineColor, lineWidth)); - painter.drawLine(8, this->height() - lineWidth, this->width() - 8, + painter.drawLine(0, this->height() - lineWidth, this->width(), this->height() - lineWidth); } @@ -439,7 +490,6 @@ SectionContainerHeader::SectionContainerHeader(QString title, QWidget *parent) : QWidget(parent) { int padding = 6; - m_hasStyle = true; layoutHeader = new QHBoxLayout; layoutHeaderPrefix = new QHBoxLayout; @@ -493,39 +543,41 @@ { Q_UNUSED(event) - if (!m_hasStyle) - return; - int lineWidth = 1; - // QColor topLineColor( palette().color(QPalette::Mid) ); - QColor bottomLineColor(palette().color(QPalette::Dark)); + int headerHeight = this->height(); + QColor bottomLineColor(palette().color(QPalette::Mid)); + QRect headerRect(0, 0, this->width(), headerHeight - lineWidth); + QPainter painter(this); + painter.setPen(Qt::NoPen); + + if (m_hasStyle) + { + #ifndef EXCLUDE_FOR_DESIGNER_PLUGIN - QColor bgColor = colorByRole(QPalette::WindowText, 0.07, isEnabled()); + QColor bgColor = colorByRole(QPalette::WindowText, 0.16, isEnabled()); + + if (m_headerType == SectionContainerHeader::Subheader) + bgColor = colorByRole(QPalette::WindowText, 0.08, isEnabled()); #else - QColor bgColor(palette().color(QPalette::WindowText)); - bgColor.setAlphaF(0.07f); + QColor bgColor(palette().color(QPalette::WindowText)); + bgColor.setAlphaF(0.16f); + + if (m_headerType == SectionContainerHeader::Subheader) + bgColor.setAlphaF(0.08f); #endif - int headerHeight = this->height(); - QRect headerRect(0, 0, this->width(), headerHeight - lineWidth); + painter.setBrush(bgColor); + painter.drawRect(headerRect); + } - QPainter painter(this); - - painter.setPen(Qt::NoPen); - painter.setBrush(bgColor); - painter.drawRect(headerRect); - painter.setBrush(Qt::NoBrush); - // Top Line - // painter.setPen( QPen(topLineColor, lineWidth) ); - // painter.drawLine( 0, 0,this->width(), 0 ); - // Bottom Line painter.setPen(QPen(bottomLineColor, lineWidth)); painter.drawLine(0, headerHeight - lineWidth, this->width(), headerHeight - lineWidth); + painter.end(); } void SectionContainerHeader::mousePressEvent(QMouseEvent *mouseEvent) Index: scribus/ui/widgets/section_container.h =================================================================== --- scribus/ui/widgets/section_container.h (Revision 26312) +++ scribus/ui/widgets/section_container.h (Arbeitskopie) @@ -23,6 +23,20 @@ friend class SectionContainer; public: + + enum HeaderType { + Header = 1, + Subheader = 2 + }; + Q_ENUM(HeaderType) + + enum HeaderSize { + Normal = 0, + Large = 1, + Condensed = 2 + }; + Q_ENUM(HeaderSize) + SectionContainerHeader(QWidget *parent = nullptr); SectionContainerHeader(QString title, QWidget *parent = nullptr); @@ -35,6 +49,8 @@ QLabel* labelTitle { nullptr }; + HeaderType m_headerType = {HeaderType::Subheader}; + HeaderSize m_headerSize = {HeaderSize::Normal}; bool m_hasStyle { true }; protected: @@ -55,12 +71,13 @@ class SectionContainer : public QWidget { Q_OBJECT - Q_CLASSINFO("Version", "1.0.0") + Q_CLASSINFO("Version", "1.1.0") Q_PROPERTY(QString title READ text WRITE setText) Q_PROPERTY(bool isCollapsible READ isCollapsible WRITE setIsCollapsible) Q_PROPERTY(bool isCollapsed READ isCollapsed WRITE setIsCollapsed) Q_PROPERTY(bool hasStyle READ hasStyle WRITE setHasStyle) + Q_PROPERTY(SectionContainerHeader::HeaderType headerType READ headerType WRITE setHeaderType) public: @@ -76,6 +93,12 @@ void setHasStyle(bool hasStyle); bool hasStyle() const; + void setHeaderType(SectionContainerHeader::HeaderType type); + SectionContainerHeader::HeaderType headerType() const; + + void setHeaderSize(SectionContainerHeader::HeaderSize size); + SectionContainerHeader::HeaderSize headerSize() const; + void setCanSaveState(bool saveState); bool canSaveState(); Index: scribus/ui/widgets/stacked_container.cpp =================================================================== --- scribus/ui/widgets/stacked_container.cpp (Revision 26312) +++ scribus/ui/widgets/stacked_container.cpp (Arbeitskopie) @@ -10,19 +10,16 @@ QSize StackedContainer::minimumSizeHint() const { - QSize s(widget(currentIndex())->sizeHint()); - s.setWidth(this->width()); - return s; + return widget(currentIndex())->minimumSizeHint(); } QSize StackedContainer::sizeHint() const { - return minimumSizeHint(); + return widget(currentIndex())->sizeHint(); } void StackedContainer::updateSize() { - //resize(this->width(), sizeHint().height()); adjustSize(); } |
|
I will probably get the resources committed first, however: - char styles -- language is also used for spelling so that title needs adjusting, but that impacts the hyphenation related boxes - para styles -- Optical margins still has text, no icons but may be able to have icons, but Typography does have them? --Typography - not sure those icons are the clearest Text Props - not sure why the colours are now in two sections. I think they should remain together. stroke colour is not typography related, as such. - I think I would reoder the new tabs. Eg I think Layout is going to be needed more often than Orphans or Lists etc so would move it below alignment Looking good so far! |
|
Hi Craig, thanks for your feedback. >> language is also used for spelling so that title needs adjusting, but that impacts the hyphenation related boxes I think we could rename it to "Hyphenation & Spelling". A spelling check button could be added there too? Alternative "Hyphenation & Language" >> Optical margins still has text, no icons but may be able to have icons, but Typography does have them? Yes, the style manager needs another iteration. A style difference to the parent style is indicated by bold text. I don't have a good solution yet how to show this difference on an icon button. The same applies to the color selection in the style manager, it is still different. >> I think they should remain together. stroke colour is not typography related, as such. Yes, I agree. I can move it back to "Font" section. I can rename this section to Font & Colors too. >> Typography - not sure those icons are the clearest Do you mean all icons, or only the new ones for "Word Tracking" and "Glyph Extension"? >> I think I would reoder the new tabs. Eg I think Layout is going to be needed more often than Orphans or Lists etc so would move it below alignment If I change the order, the main headlines don't make sense anymore. I will think about a solution. |
|
Its the spacing icons that just feel too small and less clear than the words. |
|
Nitramr, as a user I am very grateful for this improvement. Thank you for your effort. I really like this compact interface. I am very excited to see when I can use it. Some questions or comments: - Optical margins why needs a revert/reset button? If both button is off this means there is no optical margins. - Hyphenate and Dehyphenate buttons: Wouldn't this be nicer to implement with a simple toggle switch? - “Do not split paragraph” & “Keep with next paragraph”: A toggle switch would be nicer. Style difference to the parent: I really hate the bold indicator. It is so ugly. Just in idea: Add a revert (icon: revert or arrow to bottom) button behind the entry and a dynamic tool tip for example “Revert to parent: [parent value]” |
|
Hi @bubu Thanks for your feedback. >> Optical margins why needs a revert/reset button? If both button is off this means there is no optical margins. I removed the default button everywhere. It's funny, the action of this button ends in an empty function with the comment "TODO". I guess the whole optical margin implementation is in an unfinished transition state. Only the right optical margin works. I also found some leftovers of an old combo box for this function in the code. >> Hyphenate and Dehyphenate buttons: Wouldn't this be nicer to implement with a simple toggle switch? Yes and no. The selected text does not return any information about the hyphenation status. The button just bluntly triggers an action. It takes more effort to implement a toggle switch. But overall good suggestions. >> “Do not split paragraph” & “Keep with next paragraph”: A toggle switch would be nicer. Yes, I will change that. >> Just in idea: Add a revert (icon: revert or arrow to bottom) button behind the entry and a dynamic tool tip for example Yes, looks like a solid solution at the moment. See screenshots. I created two different icons. I think the round arrow is the best choice. @cbrandey I add some labels next to the space icons (that goes for text properties and style manager). Also, I did a few tests to organize the sections (grouped by categories with heading, in tabs and without and categories). I think without categories is the best option at the moment. The sections would need to be further divided to fit the categories like "Character" or "Paragraph". For example, hyphenation has a feature in both categories and so on. I think if there is no categorization, we can sort the section by importance. After some more code cleanups and tests, I will provide a new patch. |
|
Looking forward to this patch! BTW do you want me to commit those extra code files or do you have changes to those? |
|
Not necessary, I made changes in the new files too. |
|
New files and changed ui files are in zip archive to keep the patch small. I applied the patch with r26327 without conflicts, but the patch based on r26320. textproperties_2024-10-15_01.patch (305,840 bytes)
Index: resources/iconsets/1_7_0/1_7_0.xml =================================================================== --- resources/iconsets/1_7_0/1_7_0.xml (Revision 26320) +++ resources/iconsets/1_7_0/1_7_0.xml (Arbeitskopie) @@ -31,7 +31,7 @@ <license>Apache 2.0</license> <path default="yes">1_7_0</path> <activeversion>1.7.0</activeversion> - <splashscreen left="0" top="0" width="476" height="410" imageDark="scribus_splash_dark.png" imageLight="scribus_splash_light.png"></splashscreen> + <splashscreen left="0" top="0" width="476" height="410" imageDark="images/scribus_splash_dark.png" imageLight="images/scribus_splash_light.png"></splashscreen> <!-- <variant>Dark</variant>--> <nametext lang="en_US">Scribus 1.7.0</nametext> <nametext lang="fr">Scribus 1.7.0</nametext> @@ -60,7 +60,6 @@ <icon id="16/edit-clear.png" file="16/action-delete.svg" /> <icon id="16/edit-copy.png" file="16/action-copy.svg" /> <icon id="16/edit-cut.png" file="16/action-cut.svg" /> - <icon id="16/edit-delete-all.png" file="16/action-delete.svg" /> <icon id="16/edit-delete.png" file="16/action-delete.svg" /> <icon id="16/edit-find-replace.png" file="16/action-file-search.svg" /> <icon id="16/edit-paste.png" file="16/action-paste.svg" /> @@ -139,17 +138,21 @@ <icon id="u_group.png" file="16/object-group.svg" /><!-- Outliner --> <icon id="u_undo16.png" file="16/action-undo.svg" /><!-- Barcode --> <icon id="ungroup.png" file="16/object-ungroup.svg" /> + <icon id="collapse" file="16/action-chevron-right.svg" /> + <icon id="context-menu" file="16/action-menu.svg" /> + <icon id="delete-selected" file="16/action-delete-selected.svg" /> + <icon id="erase-shadow-off" file="16/action-shadow-erase-off.svg" /> + <icon id="erase-shadow-on" file="16/action-shadow-erase-on.svg" /> <icon id="expand" file="16/action-chevron-down.svg" /> - <icon id="collapse" file="16/action-chevron-right.svg" /> + <icon id="inherit-opacity-off" file="16/action-inherit-opacity-off.svg" /> <icon id="inherit-opacity-on" file="16/action-inherit-opacity-on.svg" /> - <icon id="inherit-opacity-off" file="16/action-inherit-opacity-off.svg" /> - <icon id="erase-shadow-on" file="16/action-shadow-erase-on.svg" /> - <icon id="erase-shadow-off" file="16/action-shadow-erase-off.svg" /> + <icon id="reset" file="16/action-reload.svg" /> + <icon id="reset-style-changes" file="16/action-reload.svg" /> <!-- 16/action-revert-changes.svg --> + <icon id="scale-height" file="16/action-scale-height.svg" /> + <icon id="scale-width" file="16/action-scale-width.svg" /> <icon id="swap" file="16/action-swap.svg" /> <icon id="toggle-object-coordination" file="16/object-xycoordination.svg" /> - <icon id="context-menu" file="16/action-menu.svg" /> - <icon id="scale-width" file="16/action-scale-width.svg" /> - <icon id="scale-height" file="16/action-scale-height.svg" /> + <icon id="whitespace-review-mode" file="16/action-whitespace-review.svg" /> <!-- Alerts --> <icon onLight="#E54545" onDark="#FF6666" id="22/dialog-error.png" file="16/alert-error.svg" /> @@ -225,6 +228,9 @@ <icon id="colorpicker-pattern" file="16/colorpicker-pattern.svg" /> <icon id="colorpicker-solid" file="16/colorpicker-solid.svg" /> <icon id="mask" file="16/color-mask.svg" /> + <icon id="text-color" file="16/text.svg" /> + <icon id="text-background-color" file="16/paragraph-align-horizontal-center.svg" /> + <icon id="text-outline-color" file="16/character-outline.svg" /> <!-- Cursor --> <icon id="LinkTextFrame.png" file="32/cursor-link-text-frame.svg" /> @@ -358,10 +364,6 @@ <icon id="16/page-4fold.png" file="16/page-type-fourfold.svg" /> <icon id="16/page-doublesided.png" file="16/page-type-facing.svg" /> <icon id="16/page-simple.png" file="16/page-type-single.svg" /> - <icon id="32/page-3fold.png" file="32/page-3fold.svg" /> - <icon id="32/page-4fold.png" file="32/page-4fold.svg" /> - <icon id="32/page-doublesided.png" file="32/page-double.svg" /> - <icon id="32/page-simple.png" file="32/page-simple.svg" /> <icon id="16/go-bottom.png" file="16/object-level-background.svg" /> <icon id="16/go-down.png" file="16/action-chevron-down.svg" /> <icon id="16/go-top.png" file="16/object-level-foreground.svg" /> @@ -381,16 +383,23 @@ <icon id="/16/list-remove.png" file="16/action-remove.svg" /> <icon id="16/list-remove.png" file="16/action-remove.svg" /> <icon id="22/list-remove.png" file="16/action-remove.svg" /> - <icon id="page-move" file="16/page-move.svg" /> - <icon id="page-insert" file="16/page-insert.svg" /> - <icon id="page-duplicate" file="16/page-duplicate.svg" /> - <icon id="page-import" file="16/page-import.svg" /> + <icon id="border-bottom" file="16/border-bottom.svg" /> + <icon id="border-inside" file="16/border-inside.svg" /> + <icon id="border-left" file="16/border-left.svg" /> + <icon id="border-outside" file="16/border-outside.svg" /> + <icon id="border-right" file="16/border-right.svg" /> + <icon id="border-top" file="16/border-top.svg" /> <icon id="layer-move-down" file="16/object-level-down.svg" /> <icon id="layer-move-up" file="16/object-level-up.svg" /> + <icon id="page-duplicate" file="16/page-duplicate.svg" /> <icon id="page-first-left" file="16/page-first-left.svg" /> <icon id="page-first-right" file="16/page-first-right.svg" /> + <icon id="page-import" file="16/page-import.svg" /> + <icon id="page-insert" file="16/page-insert.svg" /> + <icon id="page-move" file="16/page-move.svg" /> <icon id="page-orientation-horizontal" file="16/page-orientation-horizontal.svg" /> <icon id="page-orientation-vertical" file="16/page-orientation-vertical.svg" /> + <!-- PDF Tools --> <icon id="16/insert-button.png" file="16/pdf-button.svg" /> @@ -448,6 +457,7 @@ <icon id="plugins_16.png" file="16/properties-plugins.svg" /> <icon id="shortwords_16.png" file="16/properties-shortwords.svg" /> <icon id="python_16.png" file="16/properties-scripter.svg" /> + <icon id="section" file="16/properties-section.svg" /> <!-- Shape --> <icon id="flow-bounding.png" file="16/text-wrap-boundingbox.svg" /> @@ -470,6 +480,9 @@ <icon id="BevelJoin.png" file="16/stroke-join-bevel.svg" /> <icon id="penciladd.png" file="16/stroke-add.svg" /> <icon id="pencilsub.png" file="16/stroke-remove.svg" /> + <icon id="stroke-style" file="16/stroke-style.svg" /> + <icon id="stroke-style-edit" file="16/action-edit.svg" /> + <icon id="stroke-style-new" file="16/action-add.svg" /> <!-- Table --> <icon id="16/delete-table-columns.png" file="16/table-column-remove.svg" /> @@ -486,9 +499,6 @@ <icon id="22/split-table-cells.png" file="16/table-split-cell.svg" /> <!-- Text & Font--> - <icon id="above.png" file="16/paragraph-space-above.svg" /> - <icon id="below.png" file="16/paragraph-space-below.svg" /> - <icon id="22/text-align.png" file="16/no-icon.svg" /> <icon id="16/format-justify-center.png" file="16/paragraph-align-horizontal-center.svg" /> <icon id="16/format-justify-fill-block-right.png" file="16/paragraph-align-justify-rtl.svg" /> <icon id="16/format-justify-fill-block.png" file="16/paragraph-align-justify-ltr.svg" /> @@ -495,37 +505,83 @@ <icon id="16/format-justify-fill.png" file="16/paragraph-align-justify.svg" /> <icon id="16/format-justify-left.png" file="16/paragraph-align-left.svg" /> <icon id="16/format-justify-right.png" file="16/paragraph-align-right.svg" /> - <icon id="textbase.png" file="16/character-offset-baseline.svg" /> - <icon id="textkern.png" file="16/character-letter-spacing.svg" /> - <icon id="textscaleh.png" file="16/character-scale-width.svg" /> - <icon id="textscalev.png" file="16/character-scale-height.svg" /> - <icon id="tief.png" file="16/character-subscript.svg" /> - <icon id="hoch.png" file="16/character-superscript.svg" /> - <icon id="kapital.png" file="16/character-capitals-small.svg" /> - <icon id="AllCaps.png" file="16/character-capitals-all.svg" /> - <icon id="shadow.png" file="16/character-shadow.svg" /> - <icon id="outlined.png" file="16/character-outline.svg" /> - <icon id="unter.png" file="16/character-underline.svg" /> - <icon id="wordsOnly.png" file="16/character-underline-word.svg" /> - <icon id="strike.png" file="16/character-strikethrough.svg" /> <icon id="16/text-direction-ltr.png" file="16/paragraph-direction-ltr.svg" /> <icon id="16/text-direction-rtl.png" file="16/paragraph-direction-rtl.svg" /> - <icon id="spacewidth.png" file="16/character-space-width.svg" /> <icon id="font_otf16.png" file="16/font-otf.svg" /> <icon id="font_subst16.png" file="16/font-substitute.svg" /> <icon id="font_truetype16.png" file="16/font-truetype.svg" /> <icon id="font_type1_16.png" file="16/font-postscript.svg" /> - <icon id="22/language.png" file="16/paragraph-language.svg" /> - <icon id="22/character-style.png" file="16/character-style.svg" /> - <icon id="22/paragraph-style.png" file="16/paragraph-style.svg" /> - <icon id="linespacing2.png" file="16/font-lineheight.svg" /> - <icon id="zeichen.png" file="16/font-size.svg" /> - <icon id="firstline.png" file="16/paragraph-firstline.svg" /> - <icon id="leftindent.png" file="16/paragraph-indent-left.svg" /> - <icon id="rightindent.png" file="16/paragraph-indent-right.svg" /> - <icon id="22/orphan.png" file="16/paragraph-orphan.svg" /> - <icon id="22/widow.png" file="16/paragraph-widow.svg" /> - + <icon id="character-capitals-all" file="16/character-capitals-all.svg" /> + <icon id="character-capitals-small" file="16/character-capitals-small.svg" /> + <icon id="character-letter-tracking" file="16/character-letter-spacing.svg" /> + <icon id="character-offset-baseline" file="16/character-offset-baseline.svg" /> + <icon id="character-outline" file="16/character-outline.svg" /> + <icon id="character-scale-height" file="16/character-scale-height.svg" /> + <icon id="character-scale-width" file="16/character-scale-width.svg" /> + <icon id="character-scale-width-max" file="16/character-scale-width-max.svg" /> + <icon id="character-scale-width-min" file="16/character-scale-width-min.svg" /> + <icon id="character-shadow" file="16/character-shadow.svg" /> + <icon id="character-space-width" file="16/character-space-width.svg" /> + <icon id="character-space-width-min" file="16/character-space-width-min.svg" /> + <icon id="character-strikethrough" file="16/character-strikethrough.svg" /> + <icon id="character-style" file="16/character-style.svg" /> + <icon id="character-style-edit" file="16/action-edit.svg" /> + <icon id="character-style-new" file="16/action-add.svg" /> + <icon id="character-subscript" file="16/character-subscript.svg" /> + <icon id="character-superscript" file="16/character-superscript.svg" /> + <icon id="character-underline" file="16/character-underline.svg" /> + <icon id="character-underline-word" file="16/character-underline-word.svg" /> + <icon id="ff-afrc" file="16/ff-afrc.svg" /> + <icon id="ff-c2sc" file="16/ff-c2sc.svg" /> + <icon id="ff-c2sc-smcp" file="16/ff-c2sc-smcp.svg" /> + <icon id="ff-frac" file="16/ff-frac.svg" /> + <icon id="ff-lnum" file="16/ff-lnum.svg" /> + <icon id="ff-onum" file="16/ff-onum.svg" /> + <icon id="ff-ordn" file="16/ff-ordn.svg" /> + <icon id="ff-p2pc" file="16/ff-p2pc.svg" /> + <icon id="ff-p2pc-pcap" file="16/ff-p2pc-pcap.svg" /> + <icon id="ff-pcap" file="16/ff-pcap.svg" /> + <icon id="ff-pnum" file="16/ff-pnum.svg" /> + <icon id="ff-smcp" file="16/ff-smcp.svg" /> + <icon id="ff-subs" file="16/character-subscript.svg" /> + <icon id="ff-sups" file="16/character-superscript.svg" /> + <icon id="ff-titl" file="16/ff-titl.svg" /> + <icon id="ff-tnum" file="16/ff-tnum.svg" /> + <icon id="ff-unic" file="16/ff-unic.svg" /> + <icon id="flop-baseline" file="16/paragraph-offset-baseline.svg" /> + <icon id="flop-font" file="16/paragraph-offset-font.svg" /> + <icon id="flop-linespace" file="16/paragraph-offset-linespace.svg" /> + <icon id="flop-max" file="16/paragraph-offset-max.svg" /> + <icon id="font-face" file="16/properties-fonts.svg" /> + <icon id="font-size" file="16/font-size.svg" /> + <icon id="font-style" file="16/font-style.svg" /> + <icon id="hyphen-character" file="16/hyphenation-character.svg" /> + <icon id="hyphen-consecutive" file="16/hyphenation-consecutive.svg" /> + <icon id="hyphen-smallest-word" file="16/hyphenation-smallest-word.svg" /> + <icon id="paragraph-align-bottom" file="16/paragraph-align-bottom.svg" /> + <icon id="paragraph-align-top" file="16/paragraph-align-top.svg" /> + <icon id="paragraph-align-vertical-center" file="16/paragraph-align-vertical-center.svg" /> + <icon id="paragraph-columns" file="16/paragraph-columns.svg" /> + <icon id="paragraph-effects-style" file="16/paragraph-effects-style.svg" /> + <icon id="paragraph-indent-firstline" file="16/paragraph-firstline.svg" /> + <icon id="paragraph-indent-left" file="16/paragraph-indent-left.svg" /> + <icon id="paragraph-indent-right" file="16/paragraph-indent-right.svg" /> + <icon id="paragraph-language" file="16/paragraph-language.svg" /> + <icon id="paragraph-line-height" file="16/font-lineheight.svg" /> + <icon id="paragraph-list-offset" file="16/paragraph-list-indent-left.svg" /> + <icon id="paragraph-optical-margin-left" file="16/paragraph-optical-margin-left.svg" /> + <icon id="paragraph-optical-margin-right" file="16/paragraph-optical-margin-right.svg" /> + <icon id="paragraph-orphan" file="16/paragraph-orphan.svg" /> + <icon id="paragraph-space-above" file="16/paragraph-space-above.svg" /> + <icon id="paragraph-space-below" file="16/paragraph-space-below.svg" /> + <icon id="paragraph-style" file="16/paragraph-style.svg" /> + <icon id="paragraph-style-edit" file="16/action-edit.svg" /> + <icon id="paragraph-style-new" file="16/action-add.svg" /> + <icon id="paragraph-widow" file="16/paragraph-widow.svg" /> + <icon id="text-on-path-distance" file="16/text-on-path-distance.svg" /> + <icon id="text-on-path-flip" file="16/object-flip-vertical.svg" /> + <icon id="text-on-path-offset" file="16/text-on-path-offset.svg" /> + <!-- Tools --> <icon id="22/transform-crop-and-resize.png" file="16/tool-crop.svg" /> <icon id="16/pointer.png" file="16/tool-select.svg" /> @@ -578,10 +634,10 @@ <!-- Windows --> <icon id="close" file="16/action-close.svg" /> + <icon id="dock-auto-hide" file="16/action-pin.svg" /> <icon id="dock-float" file="16/action-window-float.svg" /> + <icon id="dock-minimize" file="16/action-minimize.svg" /> <icon id="menu-down" file="16/action-menu-down.svg" /> - <icon id="dock-auto-hide" file="16/action-pin.svg" /> - <icon id="dock-minimize" file="16/action-minimize.svg" /> <!-- Panels --> <icon id="panel-action-history" file="16/panel-action-history.svg" /> @@ -596,6 +652,29 @@ <icon id="panel-page" file="16/panel-page.svg" /> <icon id="panel-scrapbook" file="16/panel-scrapbook.svg" /> <icon id="panel-symbols" file="16/panel-symbols.svg" /> + + <!-- Open Type Font Feature Preview --> + <icon id="ff-preview-afrc" file="images/ff-afrc.svg" /> + <icon id="ff-preview-c2sc" file="images/ff-c2sc.svg" /> + <icon id="ff-preview-c2sc-smcp" file="images/ff-c2sc-smcp.svg" /> + <icon id="ff-preview-clig" file="images/ff-clig.svg" /> + <icon id="ff-preview-dlig" file="images/ff-dlig.svg" /> + <icon id="ff-preview-frac" file="images/ff-frac.svg" /> + <icon id="ff-preview-hlig" file="images/ff-hlig.svg" /> + <icon id="ff-preview-liga" file="images/ff-liga.svg" /> + <icon id="ff-preview-lnum" file="images/ff-lnum.svg" /> + <icon id="ff-preview-onum" file="images/ff-onum.svg" /> + <icon id="ff-preview-ordn" file="images/ff-ordn.svg" /> + <icon id="ff-preview-p2pc" file="images/ff-p2pc.svg" /> + <icon id="ff-preview-p2pc-pcap" file="images/ff-p2pc-pcap.svg" /> + <icon id="ff-preview-pcap" file="images/ff-pcap.svg" /> + <icon id="ff-preview-pnum" file="images/ff-pnum.svg" /> + <icon id="ff-preview-smcp" file="images/ff-smcp.svg" /> + <icon id="ff-preview-subs" file="images/ff-subs.svg" /> + <icon id="ff-preview-sups" file="images/ff-sups.svg" /> + <icon id="ff-preview-tnum" file="images/ff-tnum.svg" /> + <icon id="ff-preview-unic" file="images/ff-unic.svg" /> + <icon id="ff-preview-zero" file="images/ff-zero.svg" /> </icons> </iconset> Index: resources/iconsets/1_7_0/32/page-3fold.svg =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = image/svg+xml Property changes on: resources/iconsets/1_7_0/32/page-3fold.svg ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -image/svg+xml \ No newline at end of property Index: resources/iconsets/1_7_0/32/page-4fold.svg =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = image/svg+xml Property changes on: resources/iconsets/1_7_0/32/page-4fold.svg ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -image/svg+xml \ No newline at end of property Index: resources/iconsets/1_7_0/32/page-double.svg =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = image/svg+xml Property changes on: resources/iconsets/1_7_0/32/page-double.svg ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -image/svg+xml \ No newline at end of property Index: resources/iconsets/1_7_0/32/page-simple.svg =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = image/svg+xml Property changes on: resources/iconsets/1_7_0/32/page-simple.svg ___________________________________________________________________ Deleted: svn:mime-type ## -1 +0,0 ## -image/svg+xml \ No newline at end of property Index: resources/iconsets/CMakeLists.txt =================================================================== --- resources/iconsets/CMakeLists.txt (Revision 26320) +++ resources/iconsets/CMakeLists.txt (Arbeitskopie) @@ -115,6 +115,10 @@ file( GLOB SCRIBUS_ICONS_1_7_0_32 1_7_0/32/*.svg) install(FILES ${SCRIBUS_ICONS_1_7_0_32} DESTINATION ${ICONDIR}/1_7_0/32) +#Install our images +file( GLOB SCRIBUS_ICONS_1_7_0_IMAGES 1_7_0/images/*.svg 1_7_0/images/*.png ) +install(FILES ${SCRIBUS_ICONS_1_7_0_IMAGES} DESTINATION ${ICONDIR}/1_7_0/images) + #Install our stylesheet icons file( GLOB SCRIBUS_ICONS_1_7_0_STYLE 1_7_0/stylesheet/*.png ) install(FILES ${SCRIBUS_ICONS_1_7_0_STYLE} DESTINATION ${ICONDIR}/1_7_0/stylesheet) @@ -123,8 +127,5 @@ file( GLOB SCRIBUS_XML_1_7_0 1_7_0/*.xml ) install(FILES ${SCRIBUS_XML_1_7_0} DESTINATION ${ICONDIR}) -#Install our tools icons -file( GLOB SCRIBUS_ICONS_1_7_0_TOOLS 1_7_0/tools/*.svg ) -install(FILES ${SCRIBUS_ICONS_1_7_0_TOOLS} DESTINATION ${ICONDIR}/1_7_0/tools) ################## Index: scribus/CMakeLists_Sources.txt =================================================================== --- scribus/CMakeLists_Sources.txt (Revision 26320) +++ scribus/CMakeLists_Sources.txt (Arbeitskopie) @@ -284,6 +284,7 @@ ui/actionsearchdialog.cpp ui/aligndistribute.cpp ui/alignselect.cpp + ui/alignverticalselect.cpp ui/directionselect.cpp ui/annot.cpp ui/annota.cpp @@ -325,6 +326,7 @@ ui/effectsdialog.cpp ui/extimageprops.cpp ui/filedialogeventcatcher.cpp + ui/flopwidget.cpp ui/fontcombo.cpp ui/fontembeddingcombo.cpp ui/fontembeddingmodel.cpp @@ -379,6 +381,7 @@ ui/nodeeditpalette.cpp ui/notesstyleseditor.cpp ui/numformatcombo.cpp + ui/opticalmarginswidget.cpp ui/outlinepalette.cpp ui/outputpreview_pdf.cpp ui/outputpreview_ps.cpp @@ -445,15 +448,14 @@ ui/propertiespalette_utils.cpp ui/propertiespalette_xyz.cpp ui/propertywidget_advanced.cpp + ui/propertywidget_alignment.cpp ui/propertywidget_distance.cpp + ui/propertywidget_paragraphstyle.cpp ui/propertywidget_pareffect.cpp - ui/propertywidget_flop.cpp ui/propertywidget_hyphenation.cpp - ui/propertywidget_optmargins.cpp ui/propertywidget_orphans.cpp ui/propertywidget_pathtext.cpp ui/propertywidget_text.cpp - ui/propertywidget_textcolor.cpp ui/propertywidget_fontfeatures.cpp ui/propertywidgetbase.cpp ui/proptree.cpp @@ -490,6 +492,7 @@ ui/smcellstylewidget.cpp ui/smcellstyle.cpp ui/smcheckbox.cpp + ui/smcolorbutton.cpp ui/smcolorcombo.cpp ui/smcstylewidget.cpp ui/smdirectionselect.cpp @@ -498,6 +501,7 @@ ui/smlinestyle.cpp ui/smlinestylewidget.cpp ui/smnumformatcombo.cpp + ui/smopticalmarginswidget.cpp ui/smpstylewidget.cpp ui/smradiobutton.cpp ui/smreplacedia.cpp Index: scribus/iconmanager.cpp =================================================================== --- scribus/iconmanager.cpp (Revision 26320) +++ scribus/iconmanager.cpp (Arbeitskopie) @@ -448,7 +448,7 @@ double width = (size.width() > 0) ? size.width() : svgWidth; double height = (size.height() > 0) ? size.height() : svgHeight; - QSize newSize(QSize(width, height)); + QSize newSize(width, height); // invalid width if (size.width() < 1) Index: scribus/scribusdoc.cpp =================================================================== --- scribus/scribusdoc.cpp (Revision 26320) +++ scribus/scribusdoc.cpp (Arbeitskopie) @@ -9055,15 +9055,6 @@ itemSelection_ApplyParagraphStyle(newStyle, customSelection); } - -void ScribusDoc::itemSelection_resetOpticalMargins(Selection* customSelection) -{ - //TODO -// ParagraphStyle newStyle; -// newStyle.setOpticalMargins(i); -// itemSelection_ApplyParagraphStyle(newStyle, customSelection); -} - void ScribusDoc::itemSelection_SetTracking(int kern, Selection* customSelection) { CharStyle newStyle; Index: scribus/scribusdoc.h =================================================================== --- scribus/scribusdoc.h (Revision 26320) +++ scribus/scribusdoc.h (Arbeitskopie) @@ -1156,7 +1157,6 @@ void itemSelection_SetStrikethru(int pos, int wid, Selection* customSelection = nullptr); void itemSelection_SetEffects(int s, Selection* customSelection = nullptr); void itemSelection_SetOpticalMargins(int i, Selection* customSelection = nullptr); - void itemSelection_resetOpticalMargins(Selection* customSelection = nullptr); void itemSelection_SetColorProfile(const QString& profileName, Selection* customSelection = nullptr); void itemSelection_SetRenderIntent(int intentIndex, Selection* customSelection = nullptr); void itemSelection_SetCompressionMethod(int cmIndex, Selection* customSelection = nullptr); Index: scribus/ui/alignselect.cpp =================================================================== --- scribus/ui/alignselect.cpp (Revision 26320) +++ scribus/ui/alignselect.cpp (Arbeitskopie) @@ -14,45 +14,41 @@ #include "iconmanager.h" #include "scribusapp.h" -AlignSelect::AlignSelect(QWidget* parent) : QWidget(parent) +AlignSelect::AlignSelect(QWidget* parent) : FormWidget(parent) { IconManager& im = IconManager::instance(); buttonGroup = new QButtonGroup(this); - GroupAlignLayout = new QHBoxLayout( this ); - GroupAlignLayout->setSpacing(3); - GroupAlignLayout->setContentsMargins(0, 0, 0, 0); - TextL = new QToolButton( this ); - TextL->setIcon(im.loadIcon("16/format-justify-left.png")); TextL->setCheckable( true ); TextL->setChecked( true ); - GroupAlignLayout->addWidget( TextL ); buttonGroup->addButton(TextL, 0); TextC = new QToolButton( this ); - TextC->setIcon(im.loadIcon("16/format-justify-center.png")); TextC->setCheckable( true ); - GroupAlignLayout->addWidget( TextC ); buttonGroup->addButton(TextC, 1); TextR = new QToolButton( this ); - TextR->setIcon(im.loadIcon("16/format-justify-right.png")); TextR->setCheckable( true ); - GroupAlignLayout->addWidget( TextR ); buttonGroup->addButton(TextR, 2); TextB = new QToolButton( this ); - TextB->setIcon(im.loadIcon("16/format-justify-fill-block.png")); TextB->setCheckable( true ); - GroupAlignLayout->addWidget( TextB ); buttonGroup->addButton(TextB, 3); TextF = new QToolButton( this ); - TextF->setIcon(im.loadIcon("16/format-justify-fill.png")); TextF->setCheckable( true ); - GroupAlignLayout->addWidget( TextF ); buttonGroup->addButton(TextF, 4); + + addWidget(TextL); + addWidget(TextC); + addWidget(TextR); + addWidget(TextB); + addWidget(TextF); + + iconSetChange(); + languageChange(); + resize(minimumSizeHint()); connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); @@ -123,4 +119,5 @@ TextC->setToolTip( tr("Align Text Center")); TextB->setToolTip( tr("Align Text Justified")); TextF->setToolTip( tr("Align Text Forced Justified")); + setText( tr("&Horizontal")); } Index: scribus/ui/alignselect.h =================================================================== --- scribus/ui/alignselect.h (Revision 26320) +++ scribus/ui/alignselect.h (Arbeitskopie) @@ -14,8 +14,9 @@ class QEvent; #include "scribusapi.h" +#include "ui/widgets/form_widget.h" -class SCRIBUS_API AlignSelect : public QWidget +class SCRIBUS_API AlignSelect : public FormWidget { Q_OBJECT @@ -42,8 +43,6 @@ void setTypeStyle(int a); protected: - QHBoxLayout* GroupAlignLayout { nullptr }; - void changeEvent(QEvent *e) override; signals: Index: scribus/ui/colorpicker/colorpicker.cpp =================================================================== --- scribus/ui/colorpicker/colorpicker.cpp (Revision 26320) +++ scribus/ui/colorpicker/colorpicker.cpp (Arbeitskopie) @@ -88,7 +88,7 @@ * * ********************************************************************************* */ -void ColorPicker::setGeneralData(CPGeneralData data) +void ColorPicker::setGeneralData(const CPGeneralData& data) { m_generalData = data; @@ -107,7 +107,7 @@ colorEdit->setColorData(data); } -CPColorData ColorPicker::colorData() const +const CPColorData& ColorPicker::colorData() const { return colorEdit->colorData(); } @@ -118,7 +118,7 @@ gradientEdit->setGradientData(data); } -CPGradientData ColorPicker::gradientData() const +const CPGradientData& ColorPicker::gradientData() const { return gradientEdit->gradientData(); } @@ -300,6 +300,9 @@ default: case Context::Simple: case Context::LineMask: + case Context::Text: + case Context::TextBackground: + case Context::TextOutline: buttonSolid->setVisible(false); buttonGradient->setVisible(false); buttonHatch->setVisible(false); @@ -577,7 +580,8 @@ enablePatterns(); // Connect automatic selection handling only if the context handles the items within the color picker - if ( (context() == Context::Fill) || (context() == Context::FillMask) || (context() == Context::Line) || (context() == Context::LineMask)) + if ( (context() == Context::Fill) || (context() == Context::FillMask) || (context() == Context::Line) || (context() == Context::LineMask + || context() == Context::Text || context() == Context::TextBackground || context() == Context::TextOutline)) { connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); connect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); Index: scribus/ui/colorpicker/colorpicker.h =================================================================== --- scribus/ui/colorpicker/colorpicker.h (Revision 26320) +++ scribus/ui/colorpicker/colorpicker.h (Arbeitskopie) @@ -22,13 +22,13 @@ void setDoc(ScribusDoc* doc); - void setGeneralData(CPGeneralData data); + void setGeneralData(const CPGeneralData &data); const CPGeneralData& generalData() const; void setColorData(const CPColorData& data); - CPColorData colorData() const; + const CPColorData& colorData() const; - CPGradientData gradientData() const; + const CPGradientData& gradientData() const; void setGradientData(const CPGradientData& data); const CPGradientVectorData& gradientVectorData() const; Index: scribus/ui/colorpicker/colorpicker_color.cpp =================================================================== --- scribus/ui/colorpicker/colorpicker_color.cpp (Revision 26320) +++ scribus/ui/colorpicker/colorpicker_color.cpp (Arbeitskopie) @@ -76,6 +76,15 @@ numberAlpha->setVisible(false); labelAlpha->setVisible(false); break; + case Context::Text: + case Context::TextBackground: + case Context::TextOutline: + sectionSwatches->setVisible(true); + numberShade->setVisible(true); + labelShade->setVisible(true); + numberAlpha->setVisible(false); + labelAlpha->setVisible(false); + break; case Context::Fill: sectionSwatches->setVisible(true); numberShade->setVisible(true); Index: scribus/ui/contentpalette.cpp =================================================================== --- scribus/ui/contentpalette.cpp (Revision 26320) +++ scribus/ui/contentpalette.cpp (Arbeitskopie) @@ -25,8 +25,8 @@ #include "styles/paragraphstyle.h" #include "styles/charstyle.h" -ContentPalette::ContentPalette(QWidget *parent) : - DockPanelBase("ContentPalette", "panel-content-properties", parent) +ContentPalette::ContentPalette(QWidget *parent) : + DockPanelBase("ContentPalette", "panel-content-properties", parent) { setObjectName(QString::fromLocal8Bit("ContentPalette")); @@ -34,7 +34,7 @@ f.setPointSize(f.pointSize()-1); setFont(f); - stackedWidget = new QStackedWidget(this); + stackedWidget = new StackedContainer(this); defaultPal = new ContentPalette_Default(this); stackedWidget->addWidget(defaultPal); @@ -276,7 +276,7 @@ updatePanelTitle(); } updateGeometry(); - DockPanelBase::update(); + DockPanelBase::update(); } void ContentPalette::unitChange() @@ -303,7 +303,6 @@ return; tablePal->updateColorList(); - textPal->updateColorList(); assert (m_doc->PageColors.document()); } @@ -320,7 +319,7 @@ languageChange(); return; } - DockPanelBase::changeEvent(e); + DockPanelBase::changeEvent(e); } void ContentPalette::updatePanelTitle() @@ -365,7 +364,7 @@ void ContentPalette::update(const ParagraphStyle& style) { - textPal->updateStyle(style); + textPal->updateParagraphStyle(style); } void ContentPalette::update(const CharStyle& style) @@ -379,7 +378,7 @@ void ContentPalette::updateTextStyles() { - textPal->updateParagraphStyles(); + textPal->updateTextStyles(); } void ContentPalette::updateTextAlignment(int i) Index: scribus/ui/contentpalette.h =================================================================== --- scribus/ui/contentpalette.h (Revision 26320) +++ scribus/ui/contentpalette.h (Arbeitskopie) @@ -8,9 +8,9 @@ #define CONTENTPALETTE_H #include "scribusapi.h" -#include "scdockpalette.h" -#include "docks/dock_panelbase.h" +#include "docks/dock_panelbase.h" #include "scguardedptr.h" +#include "widgets/stacked_container.h" class QStackedWidget; @@ -29,7 +29,7 @@ class ParagraphStyle; class CharStyle; -class SCRIBUS_API ContentPalette : public DockPanelBase +class SCRIBUS_API ContentPalette : public DockPanelBase { Q_OBJECT @@ -75,7 +75,7 @@ double m_unitRatio {1.0}; int m_unitIndex {0}; - QStackedWidget* stackedWidget {nullptr}; + StackedContainer* stackedWidget {nullptr}; ContentPalette_Default* defaultPal {nullptr}; PropertiesPalette_Group* groupPal {nullptr}; PropertiesPalette_Image* imagePal {nullptr}; Index: scribus/ui/directionselect.cpp =================================================================== --- scribus/ui/directionselect.cpp (Revision 26320) +++ scribus/ui/directionselect.cpp (Arbeitskopie) @@ -13,30 +13,26 @@ #include "iconmanager.h" #include "scribusapp.h" -DirectionSelect::DirectionSelect(QWidget* parent) : QWidget(parent) +DirectionSelect::DirectionSelect(QWidget* parent) : FormWidget(parent) { buttonGroup = new QButtonGroup(this); - groupSelectLayout = new QHBoxLayout( this ); - groupSelectLayout->setSpacing(3); - groupSelectLayout->setContentsMargins(6, 0, 6, 0); - groupSelectLayout->setAlignment(Qt::AlignRight); - LTR = new QToolButton( this ); - LTR->setIcon(IconManager::instance().loadIcon("16/text-direction-ltr.png")); LTR->setCheckable( true ); LTR->setChecked( true ); - groupSelectLayout->addWidget( LTR ); + addWidget( LTR ); buttonGroup->addButton(LTR, 0); RTL = new QToolButton( this ); - RTL->setIcon(IconManager::instance().loadIcon("16/text-direction-rtl.png")); RTL->setCheckable( true ); - groupSelectLayout->addWidget( RTL ); + addWidget( RTL ); buttonGroup->addButton(RTL, 1); resize(minimumSizeHint()); + iconSetChange(); + languageChange(); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(buttonGroup, SIGNAL(idClicked(int)), this, SLOT(setTypeStyle(int))); } @@ -89,5 +85,6 @@ { LTR->setToolTip( tr("Left to right paragraph")); RTL->setToolTip( tr("Right to left paragraph")); + setText( tr("&Direction")); } Index: scribus/ui/directionselect.h =================================================================== --- scribus/ui/directionselect.h (Revision 26320) +++ scribus/ui/directionselect.h (Arbeitskopie) @@ -16,8 +16,9 @@ class QEvent; #include "scribusapi.h" +#include "ui/widgets/form_widget.h" -class SCRIBUS_API DirectionSelect : public QWidget +class SCRIBUS_API DirectionSelect : public FormWidget { Q_OBJECT @@ -38,8 +39,6 @@ void languageChange(); protected: - QHBoxLayout* groupSelectLayout { nullptr }; - int m_selected { 0 }; void changeEvent(QEvent *e) override; Index: scribus/ui/fontcombo.cpp =================================================================== --- scribus/ui/fontcombo.cpp (Revision 26320) +++ scribus/ui/fontcombo.cpp (Arbeitskopie) @@ -111,40 +111,43 @@ QWidget(parent), prefsManager(PrefsManager::instance()), showLabels(labels) -{ - ttfFont = IconManager::instance().loadPixmap("font_truetype16.png"); - otfFont = IconManager::instance().loadPixmap("font_otf16.png"); - psFont = IconManager::instance().loadPixmap("font_type1_16.png"); - substFont = IconManager::instance().loadPixmap("font_subst16.png"); - fontComboLayout = new QGridLayout(this); - fontComboLayout->setContentsMargins(0, 0, 0, 0); - if (showLabels) - fontComboLayout->setSpacing(6); - else - fontComboLayout->setSpacing(3); - int col = 0; - if (showLabels) - { - fontFaceLabel = new QLabel(this); - fontStyleLabel = new QLabel(this); - fontComboLayout->addWidget(fontFaceLabel, 0, 0); - fontComboLayout->addWidget(fontStyleLabel, 1, 0); - fontComboLayout->setColumnStretch(1, 10); - col = 1; - } +{ fontFamily = new QComboBox(this); fontFamily->setEditable(true); fontFamily->setValidator(new FontComboValidator(fontFamily)); fontFamily->setInsertPolicy(QComboBox::NoInsert); fontFamily->setItemDelegate(new FontFamilyDelegate(this)); - fontComboLayout->addWidget(fontFamily, 0, col); + + fontFaceLabel = new FormWidget(this); + fontFaceLabel->setLabelVisibility(false); + fontFaceLabel->addWidget(fontFamily); + fontStyle = new QComboBox(this); - fontComboLayout->addWidget(fontStyle, 1, col); + fontStyle->setSizeAdjustPolicy(QComboBox::AdjustToContents); + + fontStyleLabel = new FormWidget(this); + fontStyleLabel->addWidget(fontStyle); + + fontComboLayout = new QGridLayout(this); + fontComboLayout->setContentsMargins(0, 0, 0, 0); + fontComboLayout->setSpacing(8); + fontComboLayout->addWidget(fontFaceLabel, 0, 0, 1, 4); + fontComboLayout->addWidget(fontStyleLabel, 1, 0); + fontComboLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding), 1, 1); + fontComboLayout->addWidget(new QWidget(), 1, 2); + fontComboLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 1, 3); + isForAnnotation = true; // this is merely to ensure that the list is rebuilt + + iconSetChange(); + languageChange(); rebuildList(nullptr); + connect(fontFamily, SIGNAL(activated(int)), this, SLOT(familySelected(int))); connect(fontStyle, SIGNAL(activated(int)), this, SLOT(styleSelected(int))); - languageChange(); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + //connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); + } void FontComboH::changeEvent(QEvent *e) @@ -157,15 +160,30 @@ void FontComboH::languageChange() { - if (showLabels) - { - fontFaceLabel->setText( tr("Family:")); - fontStyleLabel->setText( tr("Style:")); - } + fontFaceLabel->setText( tr("Family")); + fontStyleLabel->setText( tr("Style")); fontFamily->setToolTip( tr("Font Family of Selected Text or Text Frame")); fontStyle->setToolTip( tr("Font Style of Selected Text or Text Frame")); } +void FontComboH::iconSetChange() +{ + IconManager &im = IconManager::instance(); + + ttfFont = im.loadPixmap("font_truetype16.png"); + otfFont = im.loadPixmap("font_otf16.png"); + psFont = im.loadPixmap("font_type1_16.png"); + substFont = im.loadPixmap("font_subst16.png"); + + fontFaceLabel->setPixmap(im.loadPixmap("font-face")); + fontStyleLabel->setPixmap(im.loadPixmap("font-style")); +} + +void FontComboH::toggleLabelVisibility(bool v) +{ + fontStyleLabel->setLabelVisibility(v); +} + void FontComboH::familySelected(int id) { disconnect(fontStyle, SIGNAL(activated(int)), this, SLOT(styleSelected(int))); @@ -332,6 +350,19 @@ fontStyle->blockSignals(styleSigBlocked); } +void FontComboH::setGuestWidget(QWidget *widget) +{ + fontComboLayout->addWidget(widget, 1, 2); +} + +QWidget *FontComboH::guestWidget() +{ + if (fontComboLayout->itemAtPosition(1, 2)->widget() == nullptr) + return new QWidget(); + + return fontComboLayout->itemAtPosition(1, 2)->widget(); +} + // This code borrowed from Qt project qfontcombobox.cpp static QFontDatabase::WritingSystem writingSystemFromScript(QLocale::Script script) Index: scribus/ui/fontcombo.h =================================================================== --- scribus/ui/fontcombo.h (Revision 26320) +++ scribus/ui/fontcombo.h (Arbeitskopie) @@ -30,6 +30,7 @@ #include <QValidator> #include "scribusapi.h" +#include "ui/widgets/form_widget.h" class QEvent; class QFont; @@ -76,9 +77,14 @@ QString currentFont() const; void rebuildList(ScribusDoc *currentDoc, bool forAnnotation = false, bool forSubstitute = false); + void setGuestWidget( QWidget * widget); + QWidget* guestWidget(); + public slots: void setCurrentFont(const QString& f); void languageChange(); + void iconSetChange(); + void toggleLabelVisibility(bool v); signals: void fontSelected(QString); @@ -90,8 +96,8 @@ protected: QComboBox* fontFamily { nullptr }; QComboBox* fontStyle { nullptr }; - QLabel *fontFaceLabel { nullptr }; - QLabel *fontStyleLabel { nullptr }; + FormWidget *fontFaceLabel { nullptr }; + FormWidget *fontStyleLabel { nullptr }; QGridLayout* fontComboLayout { nullptr }; PrefsManager& prefsManager; ScribusDoc *currDoc { nullptr }; Index: scribus/ui/newmarginwidget.cpp =================================================================== --- scribus/ui/newmarginwidget.cpp (Revision 26320) +++ scribus/ui/newmarginwidget.cpp (Arbeitskopie) @@ -6,11 +6,12 @@ */ #include "newmarginwidget.h" +#include "iconmanager.h" #include "scrspinbox.h" #include "units.h" #include "ui/marginpresetlayout.h" #include "ui/useprintermarginsdialog.h" -#include "scribusapp.h" +#include "scribusapp.h" NewMarginWidget::NewMarginWidget(QWidget* parent) : QWidget(parent) @@ -40,8 +41,8 @@ presetLayoutLabel->resize(0,0); presetLayoutComboBox->hide(); presetLayoutLabel->hide(); - horizontalLayout->removeWidget(presetLayoutComboBox); - horizontalLayout->removeWidget(presetLayoutLabel); + horizontalLayout->removeWidget(presetLayoutComboBox); + horizontalLayout->removeWidget(presetLayoutLabel); } if ((m_flags & ShowPrinterMargins) == 0) { @@ -48,14 +49,16 @@ printerMarginsPushButton->blockSignals(true); printerMarginsPushButton->resize(0,0); printerMarginsPushButton->hide(); - horizontalLayout->removeWidget(printerMarginsPushButton); + horizontalLayout->removeWidget(printerMarginsPushButton); } setFacingPages(!(layoutType == singlePage)); languageChange(); - iconSetChange(); + iconSetChange(); + toggleLabelVisibility(true); - connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); +// connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); connect(topMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setTop())); connect(bottomMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setBottom())); connect(leftMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setLeft())); @@ -75,7 +78,7 @@ rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance between the right margin guide and the edge of the page. If a double-sided, 3 or 4-fold layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>"); marginLinkButton->setToolTip( "<qt>" + tr( "Ensure all margins have the same value" ) + "</qt>"); } - else + else if (m_flags & BleedWidgetFlags) { topMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the top of the physical page" ) + "</qt>" ); bottomMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the bottom of the physical page" ) + "</qt>" ); @@ -83,16 +86,45 @@ rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance for bleed from the right of the physical page" ) + "</qt>"); marginLinkButton->setToolTip( "<qt>" + tr( "Ensure all bleeds have the same value" ) + "</qt>"); } + else + { + topMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the top" ) + "</qt>" ); + bottomMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the bottom" ) + "</qt>" ); + leftMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the left" ) + "</qt>" ); + rightMarginSpinBox->setToolTip( "<qt>" + tr( "Distance from the right" ) + "</qt>"); + marginLinkButton->setToolTip( "<qt>" + tr( "Ensure all distances have the same value" ) + "</qt>"); + } printerMarginsPushButton->setToolTip( "<qt>" + tr( "Import the margins for the selected page size from the available printers" ) + "</qt>"); - - leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left")); - rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right")); + + leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left")); + rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right")); } -void NewMarginWidget::iconSetChange() -{ -} - +void NewMarginWidget::iconSetChange() +{ + IconManager &im = IconManager::instance(); + + leftMarginLabel->setPixmap(im.loadPixmap(m_facingPages ? "border-inside" : "border-left")); + rightMarginLabel->setPixmap(im.loadPixmap(m_facingPages ? "border-outside" : "border-right")); + topMarginLabel->setPixmap(im.loadPixmap("border-top")); + bottomMarginLabel->setPixmap(im.loadPixmap("border-bottom")); +} + +void NewMarginWidget::toggleLabelVisibility(bool v) +{ + formWidget->setLabelVisibility(v); + leftMarginLabel->setLabelVisibility(v); + rightMarginLabel->setLabelVisibility(v); + topMarginLabel->setLabelVisibility(v); + bottomMarginLabel->setLabelVisibility(v); + + leftMarginLabel->setIconVisibility(!v); + rightMarginLabel->setIconVisibility(!v); + topMarginLabel->setIconVisibility(!v); + bottomMarginLabel->setIconVisibility(!v); + +} + void NewMarginWidget::setNewValues(const MarginStruct& margs) { m_marginData = m_savedMarginData = margs; @@ -101,24 +133,35 @@ void NewMarginWidget::setPageWidth(double newWidth) { - leftMarginSpinBox->setMaximum(qMax(0.0, newWidth * m_unitRatio - rightMarginSpinBox->value())); - rightMarginSpinBox->setMaximum(qMax(0.0, newWidth * m_unitRatio - leftMarginSpinBox->value())); + // if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + // { + leftMarginSpinBox->setMaximum(qMax(0.0, newWidth * m_unitRatio - rightMarginSpinBox->value())); + rightMarginSpinBox->setMaximum(qMax(0.0, newWidth * m_unitRatio - leftMarginSpinBox->value())); +// } m_pageWidth = newWidth; setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setPageHeight(double newHeight) { - topMarginSpinBox->setMaximum(qMax(0.0, newHeight * m_unitRatio - bottomMarginSpinBox->value())); - bottomMarginSpinBox->setMaximum(qMax(0.0,newHeight * m_unitRatio - topMarginSpinBox->value())); + // if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + // { + topMarginSpinBox->setMaximum(qMax(0.0, newHeight * m_unitRatio - bottomMarginSpinBox->value())); + bottomMarginSpinBox->setMaximum(qMax(0.0,newHeight * m_unitRatio - topMarginSpinBox->value())); +// } m_pageHeight = newHeight; setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setTop() { double newVal = topMarginSpinBox->value() / m_unitRatio; - bottomMarginSpinBox->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - topMarginSpinBox->value())); +// if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + bottomMarginSpinBox->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - topMarginSpinBox->value())); if (marginLinkButton->isChecked() && m_savedPresetItem == PresetLayout::none) { m_marginData.set(newVal, newVal, newVal, newVal); @@ -127,12 +170,15 @@ else m_marginData.setTop(newVal); setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setBottom() { double newVal = bottomMarginSpinBox->value() / m_unitRatio; - topMarginSpinBox->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - bottomMarginSpinBox->value())); +// if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + topMarginSpinBox->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - bottomMarginSpinBox->value())); if (marginLinkButton->isChecked() && m_savedPresetItem == PresetLayout::none) { m_marginData.set(newVal, newVal, newVal, newVal); @@ -141,12 +187,15 @@ else m_marginData.setBottom(newVal); setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setLeft() { double newVal = leftMarginSpinBox->value() / m_unitRatio; - rightMarginSpinBox->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - leftMarginSpinBox->value())); +// if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + rightMarginSpinBox->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - leftMarginSpinBox->value())); if (marginLinkButton->isChecked() && m_savedPresetItem == PresetLayout::none) { m_marginData.set(newVal, newVal, newVal, newVal); @@ -155,12 +204,15 @@ else m_marginData.setLeft(newVal); setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setRight() { double newVal = rightMarginSpinBox->value() / m_unitRatio; - leftMarginSpinBox->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - rightMarginSpinBox->value())); +// if ((m_flags & MarginWidgetFlags) == 0 || (m_flags & BleedWidgetFlags) == 0) + leftMarginSpinBox->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - rightMarginSpinBox->value())); if (marginLinkButton->isChecked() && m_savedPresetItem == PresetLayout::none) { m_marginData.set(newVal, newVal, newVal, newVal); @@ -169,6 +221,8 @@ else m_marginData.setRight(newVal); setPreset(); + emit valuesChanged(m_marginData); + } void NewMarginWidget::setNewUnit(int newUnitIndex) @@ -242,8 +296,8 @@ topMarginSpinBox->blockSignals(false); bottomMarginSpinBox->blockSignals(false); m_savedPresetItem = item; - - emit marginChanged(m_marginData); + + emit marginChanged(m_marginData); } void NewMarginWidget::setPageSize(const QString& pageSize) @@ -284,8 +338,8 @@ rightMarginSpinBox->setValue(leftMarginSpinBox->value()); double newVal = leftMarginSpinBox->value() / m_unitRatio; m_marginData.set(newVal, newVal, newVal, newVal); - - emit marginChanged(m_marginData); + + emit marginChanged(m_marginData); } leftMarginSpinBox->blockSignals(leftBlocked); @@ -336,10 +390,10 @@ { m_facingPages = facing; m_pageType = pageType; - - leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left")); - rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right")); - + + leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left")); + rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right")); + setPreset(); } Index: scribus/ui/newmarginwidget.h =================================================================== --- scribus/ui/newmarginwidget.h (Revision 26320) +++ scribus/ui/newmarginwidget.h (Arbeitskopie) @@ -22,10 +22,11 @@ enum SetupFlags { - ShowPreset = 1, - ShowPrinterMargins = 2, - MarginWidgetFlags = 3, - BleedWidgetFlags = 4, + DistanceWidgetFlags = 0, + ShowPreset = 1, + ShowPrinterMargins = 2, + MarginWidgetFlags = 3, + BleedWidgetFlags = 4 }; void setup(const MarginStruct& margs, int layoutType, int unitIndex, int flags = MarginWidgetFlags); @@ -47,6 +48,7 @@ public slots: void languageChange(); void iconSetChange(); + void toggleLabelVisibility(bool v); void setTop(); void setBottom(); void setLeft(); @@ -74,6 +76,7 @@ signals: void marginChanged(MarginStruct); + void valuesChanged(MarginStruct); }; #endif // NEWMARGINWIDGET_H Index: scribus/ui/prefs_documentsections.cpp =================================================================== --- scribus/ui/prefs_documentsections.cpp (Revision 26320) +++ scribus/ui/prefs_documentsections.cpp (Arbeitskopie) @@ -25,7 +25,7 @@ languageChange(); m_caption = tr("Sections"); - m_icon = "tabtocindex_16.png"; + m_icon = "section"; connect(sectionsTable, SIGNAL(cellChanged(int,int)), this, SLOT(tableItemChanged(int,int))); connect(addButton, SIGNAL(clicked()), this, SLOT(addEntry())); Index: scribus/ui/propertiespalette_line.cpp =================================================================== --- scribus/ui/propertiespalette_line.cpp (Revision 26320) +++ scribus/ui/propertiespalette_line.cpp (Arbeitskopie) @@ -23,6 +23,7 @@ #include "scribusapp.h" #include "scribusdoc.h" #include "selection.h" +#include "stylemanager.h" #include "ui/colorpicker/colorpicker_enum.h" #include "ui/widgets/popup_menu.h" #include "units.h" @@ -84,6 +85,8 @@ connect(buttonSwapMarker, SIGNAL(clicked(bool)), this, SLOT(swapLineMarker())); connect(comboBlendmode, SIGNAL(currentIndexChanged(int)), this, SLOT(handleLineBlendmode(int))); connect(comboLineStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(handleLineStyle(int))); + connect(buttonLineStyleNew, SIGNAL(clicked(bool)), this, SLOT(handleLineStyleNew())); + connect(buttonLineStyleEdit, SIGNAL(clicked(bool)), this, SLOT(handleLineStyleEdit())); connect(buttonLineColor, SIGNAL(changed()), this, SLOT(handleLineColor())); connect(buttonLineColor, SIGNAL(gradientVectorChanged()), this, SLOT(handleLineColorVector())); connect(buttonLineMask, SIGNAL(changed()), this, SLOT(handleLineOpacity())); @@ -304,6 +307,8 @@ comboLineStyle->setCurrentText(m_item->NamedLStyle); } + buttonLineStyleEdit->setEnabled(comboLineStyle->currentIndex() != 0); + lineTypeLabel->setVisible(!hasStyle); lineWidthLabel->setVisible(!hasStyle); lineJoinLabel->setVisible(!hasStyle); @@ -669,8 +674,27 @@ return; bool setter = (c == 0); m_doc->itemSelection_SetNamedLineStyle(setter ? QString("") : comboLineStyle->currentText()); + + buttonLineStyleEdit->setEnabled(comboLineStyle->currentIndex() != 0); } +void PropertiesPalette_Line::handleLineStyleNew() +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + + m_ScMW->styleMgr()->showAsNewLineStyle(); +} + +void PropertiesPalette_Line::handleLineStyleEdit() +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + + if (comboLineStyle->currentIndex() != 0) + m_ScMW->styleMgr()->showAsEditLineStyle(comboLineStyle->currentText()); +} + void PropertiesPalette_Line::handleLineOpacity(/*double opacity*/) { if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning()) @@ -842,6 +866,10 @@ buttonSwapMarker->setIcon(im.loadIcon("swap")); buttonLineMask->setDotIcon(im.loadIcon("mask", 8)); + lineStyleLabel->setPixmap(im.loadPixmap("stroke-style")); + buttonLineStyleNew->setIcon(im.loadIcon("stroke-style-new")); + buttonLineStyleEdit->setIcon(im.loadIcon("stroke-style-edit")); + } void PropertiesPalette_Line::languageChange() Index: scribus/ui/propertiespalette_line.h =================================================================== --- scribus/ui/propertiespalette_line.h (Revision 26320) +++ scribus/ui/propertiespalette_line.h (Arbeitskopie) @@ -85,6 +85,8 @@ void handleLineWidth(); void handleLineType(); void handleLineStyle(int c); + void handleLineStyleNew(); + void handleLineStyleEdit(); void handleLineJoin(); void handleLineEnd(); void handleDashChange(); Index: scribus/ui/propertiespalette_shadow.cpp =================================================================== --- scribus/ui/propertiespalette_shadow.cpp (Revision 26320) +++ scribus/ui/propertiespalette_shadow.cpp (Arbeitskopie) @@ -282,21 +282,6 @@ labelErase->setLabelVisibility(v); } -//void PropertiesPalette_Shadow::updateColorList() -//{ -// if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning()) -// return; -// disconnectSlots(); - -//// colorPicker->loadLists(); - -//// QString color = colorPicker->colorName(); -//// colorPicker->setColors(m_doc->PageColors); -//// colorPicker->setColor(color); - -// connectSlots(); -//} - void PropertiesPalette_Shadow::handleNewValues() { if (!m_haveItem || !m_haveDoc) Index: scribus/ui/propertiespalette_text.cpp =================================================================== --- scribus/ui/propertiespalette_text.cpp (Revision 26320) +++ scribus/ui/propertiespalette_text.cpp (Arbeitskopie) @@ -13,32 +13,30 @@ #endif #include <cmath> #include <QSignalBlocker> +#include <QStackedLayout> #include "appmodes.h" #include "commonstrings.h" #include "fontcombo.h" #include "iconmanager.h" -#include "localemgr.h" #include "pageitem.h" #include "pageitem_table.h" #include "pageitem_textframe.h" #include "propertywidget_advanced.h" +#include "propertywidget_alignment.h" #include "propertywidget_distance.h" -#include "propertywidget_flop.h" #include "propertywidget_fontfeatures.h" #include "propertywidget_hyphenation.h" -#include "propertywidget_optmargins.h" #include "propertywidget_orphans.h" +#include "propertywidget_paragraphstyle.h" #include "propertywidget_pareffect.h" #include "propertywidget_pathtext.h" #include "propertywidget_text.h" -#include "propertywidget_textcolor.h" #include "scribus.h" #include "scribusapp.h" #include "selection.h" #include "stylecombos.h" #include "undomanager.h" -#include "langmgr.h" #include "widgets/section_container.h" //using namespace std; @@ -45,100 +43,90 @@ PropertiesPalette_Text::PropertiesPalette_Text( QWidget* parent) : QWidget(parent) { + styleWidgets = new PropertyWidget_ParagraphStyle(this); + scStyles = new SectionContainer(tr("Styles"), "SectionTPStyles", true, true); + scStyles->setCanSaveState(true); + scStyles->setWidget(styleWidgets); + scStyles->restorePreferences(); - advancedWidgets = new PropertyWidget_Advanced(this); - scAdvanced = new SectionContainer(tr("Advanced Settings"), "SectionTXAdvanced", true, false); - scAdvanced->setCanSaveState(true); - scAdvanced->setWidget(advancedWidgets); - scAdvanced->restorePreferences(); + textWidgets = new PropertyWidget_Text(this); + scText = new SectionContainer(tr("Font"), "SectionTPFont", true, true); + scText->setCanSaveState(true); + scText->setWidget(textWidgets); + scText->restorePreferences(); + alignmentWidgets = new PropertyWidget_Alignment(this); + scAlignment = new SectionContainer(tr("Alignment && Tabs"), "SectionTPAlignment", true, true); + scAlignment->setCanSaveState(true); + scAlignment->setWidget(alignmentWidgets); + scAlignment->restorePreferences(); + distanceWidgets = new PropertyWidget_Distance(this); - scDistance = new SectionContainer(tr("Columns && Text Distances"), "SectionTXColDist", true, false); + scDistance = new SectionContainer(tr("Columns && Margins"), "SectionTPColumnsMargins", true, false); scDistance->setCanSaveState(true); scDistance->setWidget(distanceWidgets); scDistance->restorePreferences(); - flopBox = new PropertyWidget_Flop(this); - scFlop = new SectionContainer(tr("First Line Offset"), "SectionTXLineOffset", true, false); - scFlop->setCanSaveState(true); - scFlop->setWidget(flopBox); - scFlop->restorePreferences(); + advancedWidgets = new PropertyWidget_Advanced(this); + scAdvanced = new SectionContainer(tr("Typography"), "SectionTPTypography", true, false); + scAdvanced->setCanSaveState(true); + scAdvanced->setWidget(advancedWidgets); + scAdvanced->restorePreferences(); - fontfeaturesWidget = new PropertyWidget_FontFeatures(this); - scFontFeatures = new SectionContainer(tr("Font Features"), "SectionTXFontFeatures", true, false); - scFontFeatures->setCanSaveState(true); - scFontFeatures->setWidget(fontfeaturesWidget); - scFontFeatures->restorePreferences(); + parEffectWidgets = new PropertyWidget_ParEffect(this); + scParEffect = new SectionContainer(tr("Lists && Drop Caps"), "SectionTPLists", true, false); + scParEffect->setCanSaveState(true); + scParEffect->setWidget(parEffectWidgets); + scParEffect->restorePreferences(); hyphenationWidget = new PropertyWidget_Hyphenation(this); - scHyphenation = new SectionContainer(tr("Hyphenation"), "SectionTXHyphenation", true, false); + scHyphenation = new SectionContainer(tr("Hyphenation && Language"), "SectionTPHyphenation", true, false); scHyphenation->setCanSaveState(true); scHyphenation->setWidget(hyphenationWidget); scHyphenation->restorePreferences(); - optMargins = new PropertyWidget_OptMargins(this); - scOptMargins = new SectionContainer(tr("Optical Margins"), "SectionTXMargins", true, false); - scOptMargins->setCanSaveState(true); - scOptMargins->setWidget(optMargins); - scOptMargins->restorePreferences(); - orphanBox = new PropertyWidget_Orphans(this); - scOrphans = new SectionContainer(tr("Orphans and Widows"), "SectionTXOrphansWidow", true, false); + scOrphans = new SectionContainer(tr("Orphans && Widows"), "SectionTPOrphansWidows", true, false); scOrphans->setCanSaveState(true); scOrphans->setWidget(orphanBox); scOrphans->restorePreferences(); - parEffectWidgets = new PropertyWidget_ParEffect(this); - scParEffect = new SectionContainer(tr("Paragraph Effects"), "SectionTXEffects", true, false); - scParEffect->setCanSaveState(true); - scParEffect->setWidget(parEffectWidgets); - scParEffect->restorePreferences(); + fontfeaturesWidget = new PropertyWidget_FontFeatures(this); + scFontFeatures = new SectionContainer(tr("OpenType Features"), "SectionTPOpenTypeFeatures", true, false); + scFontFeatures->setCanSaveState(true); + scFontFeatures->setWidget(fontfeaturesWidget); + scFontFeatures->restorePreferences(); pathTextWidgets = new PropertyWidget_PathText(this); - scPathText = new SectionContainer(tr("Path Text Properties"), "SectionTXPathText", true, false); + scPathText = new SectionContainer(tr("Text on Path"), "SectionTPTextOnPath", true, false); scPathText->setCanSaveState(true); scPathText->setWidget(pathTextWidgets); scPathText->restorePreferences(); - textWidgets = new PropertyWidget_Text(this); - scText = new SectionContainer(tr("Text"), "SectionTXText", true, true); - scText->setCanSaveState(true); - scText->setWidget(textWidgets); - scText->restorePreferences(); - - colorWidgets = new PropertyWidget_TextColor(this); - scTextColor = new SectionContainer(tr("Color && Effects"), "SectionTXColorEffects", true, false); - scTextColor->setCanSaveState(true); - scTextColor->setWidget(colorWidgets); - scTextColor->restorePreferences(); - // Layout stack QVBoxLayout * lyt = new QVBoxLayout(); lyt->setContentsMargins(0, 0, 0, 0); lyt->setSpacing(0); + lyt->addWidget(scStyles); lyt->addWidget(scText); - lyt->addWidget(scTextColor); - lyt->addWidget(scFlop); - lyt->addWidget(scOrphans); + lyt->addWidget(scAlignment); + lyt->addWidget(scDistance); + lyt->addWidget(scAdvanced); lyt->addWidget(scParEffect); - lyt->addWidget(scDistance); - lyt->addWidget(scOptMargins); lyt->addWidget(scHyphenation); - lyt->addWidget(scAdvanced); + lyt->addWidget(scOrphans); lyt->addWidget(scFontFeatures); lyt->addWidget(scPathText); lyt->addStretch(1); + setLayout(lyt); - + setEnabled(false); iconSetChange(); languageChange(); - connect(flopBox->flopGroup, SIGNAL(idClicked(int)), this, SLOT(handleFirstLinePolicy(int))); - connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); - setEnabled(false); } void PropertiesPalette_Text::setMainWindow(ScribusMainWindow* mw) @@ -147,12 +135,12 @@ textWidgets->setMainWindow(mw); advancedWidgets->setMainWindow(mw); + alignmentWidgets->setMainWindow(mw); fontfeaturesWidget->setMainWindow(mw); - colorWidgets->setMainWindow(mw); distanceWidgets->setMainWindow(mw); hyphenationWidget->setMainWindow(mw); + styleWidgets->setMainWindow(mw); parEffectWidgets->setMainWindow(mw); - optMargins->setMainWindow(mw); pathTextWidgets->setMainWindow(mw); connect(m_ScMW, SIGNAL(UpdateRequest(int)) , this , SLOT(handleUpdateRequest(int))); @@ -180,13 +168,12 @@ textWidgets->setDoc(m_doc); advancedWidgets->setDoc(m_doc); + alignmentWidgets->setDoc(m_doc); fontfeaturesWidget->setDoc(m_doc); - colorWidgets->setDoc(m_doc); distanceWidgets->setDoc(m_doc); parEffectWidgets->setDoc(m_doc); - flopBox->setDoc(m_doc); hyphenationWidget->setDoc(m_doc); - optMargins->setDoc(m_doc); + styleWidgets->setDoc(m_doc); orphanBox->setDoc(m_doc); pathTextWidgets->setDoc(m_doc); @@ -209,12 +196,11 @@ textWidgets->setDoc(nullptr); advancedWidgets->setDoc(nullptr); + alignmentWidgets->setDoc(nullptr); fontfeaturesWidget->setDoc(nullptr); - colorWidgets->setDoc(nullptr); distanceWidgets->setDoc(nullptr); - flopBox->setDoc(nullptr); hyphenationWidget->setDoc(nullptr); - optMargins->setDoc(nullptr); + styleWidgets->setDoc(nullptr); orphanBox->setDoc(nullptr); parEffectWidgets->setDoc(nullptr); pathTextWidgets->setDoc(nullptr); @@ -226,7 +212,6 @@ { m_haveItem = false; m_item = nullptr; - colorWidgets->setCurrentItem(m_item); handleSelectionChanged(); } @@ -256,7 +241,6 @@ if (m_doc->m_Selection->count() > 1) { setEnabled(false); - flopBox->flopRealHeight->setChecked(true); } else { @@ -291,29 +275,10 @@ void PropertiesPalette_Text::handleUpdateRequest(int updateFlags) { - // ColorWidget will handle its update itself - /*if (updateFlags & reqColorsUpdate) - updateColorList();*/ - textWidgets->handleUpdateRequest(updateFlags); + styleWidgets->handleUpdateRequest(updateFlags); + parEffectWidgets->handleUpdateRequest(updateFlags); - if (updateFlags & reqCharStylesUpdate) - { -// charStyleCombo->updateStyleList(); - parEffectWidgets->updateCharStyles(); - } -// if (updateFlags & reqParaStylesUpdate) -// paraStyleCombo->updateStyleList(); -// if (updateFlags & reqDefFontListUpdate) -// fonts->rebuildList(nullptr); -// if (updateFlags & reqDocFontListUpdate) -// fonts->rebuildList(m_haveDoc ? m_doc : nullptr); - if (updateFlags & reqStyleComboDocUpdate) - { -// paraStyleCombo->setDoc(m_haveDoc ? m_doc : nullptr); -// charStyleCombo->setDoc(m_haveDoc ? m_doc : nullptr); - parEffectWidgets->setDoc(m_haveDoc ? m_doc : nullptr); - } } void PropertiesPalette_Text::setCurrentItem(PageItem *item) @@ -333,8 +298,6 @@ m_haveItem = false; m_item = item; - showFirstLinePolicy(m_item->firstLineOffset()); - if ((m_item->isGroup()) && (!m_item->isSingleSel)) { setEnabled(false); @@ -344,7 +307,7 @@ if (!sender()) { - colorWidgets->handleSelectionChanged(); + alignmentWidgets->handleSelectionChanged(); distanceWidgets->handleSelectionChanged(); parEffectWidgets->handleSelectionChanged(); } @@ -354,7 +317,7 @@ ParagraphStyle parStyle = m_item->itemText.defaultStyle(); if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable) m_item->currentTextProps(parStyle); - updateStyle(parStyle); + updateParagraphStyle(parStyle); } if (m_item->isOSGFrame()) { @@ -368,7 +331,7 @@ void PropertiesPalette_Text::iconSetChange() { - textWidgets->iconSetChange(); + // no local icons to change } void PropertiesPalette_Text::unitChange() @@ -379,11 +342,9 @@ m_haveItem = false; advancedWidgets->unitChange(); + alignmentWidgets->unitChange(); fontfeaturesWidget->unitChange(); - colorWidgets->unitChange(); distanceWidgets->unitChange(); - flopBox->unitChange(); - optMargins->unitChange(); pathTextWidgets->unitChange(); parEffectWidgets->unitChange(); textWidgets->unitChange(); @@ -393,12 +354,7 @@ void PropertiesPalette_Text::localeChange() { - textWidgets->localeChange(); - advancedWidgets->localeChange(); - colorWidgets->localeChange(); - distanceWidgets->localeChange(); - parEffectWidgets->localeChange(); - pathTextWidgets->localeChange(); + // Nothing to do here! } void PropertiesPalette_Text::showFontSize(double s) @@ -408,21 +364,9 @@ void PropertiesPalette_Text::showLanguage(const QString& w) { - textWidgets->showLanguage(w); + hyphenationWidget->showLanguage(w); } -void PropertiesPalette_Text::showFirstLinePolicy( FirstLineOffsetPolicy f ) -{ - if (f == FLOPFontAscent) - flopBox->flopFontAscent->setChecked(true); - else if (f == FLOPLineSpacing) - flopBox->flopLineSpacing->setChecked(true); - else if (f == FLOPRealGlyphHeight) - flopBox->flopRealHeight->setChecked(true); //It’s historical behaviour. - else // if (f == FLOPBaseline) - flopBox->flopBaselineGrid->setChecked(true); -} - void PropertiesPalette_Text::updateCharStyle(const CharStyle& charStyle) { if (!m_ScMW || m_ScMW->scriptIsRunning()) @@ -430,12 +374,11 @@ advancedWidgets->updateCharStyle(charStyle); fontfeaturesWidget->updateCharStyle(charStyle); - colorWidgets->updateCharStyle(charStyle); hyphenationWidget->updateCharStyle(charStyle); textWidgets->updateCharStyle(charStyle); } -void PropertiesPalette_Text::updateStyle(const ParagraphStyle& newCurrent) +void PropertiesPalette_Text::updateParagraphStyle(const ParagraphStyle& newCurrent) { if (!m_ScMW || m_ScMW->scriptIsRunning()) return; @@ -442,49 +385,30 @@ advancedWidgets->updateStyle(newCurrent); fontfeaturesWidget->updateStyle(newCurrent); - colorWidgets->updateStyle(newCurrent); - optMargins->updateStyle(newCurrent); - orphanBox->updateStyle (newCurrent); + orphanBox->updateStyle(newCurrent); parEffectWidgets->updateStyle(newCurrent); hyphenationWidget->updateStyle(newCurrent); textWidgets->updateStyle(newCurrent); + styleWidgets->updateStyle(newCurrent); + alignmentWidgets->updateStyle(newCurrent); } -void PropertiesPalette_Text::updateCharStyles() -{ - textWidgets->updateCharStyles(); - parEffectWidgets->updateCharStyles(); -} - -void PropertiesPalette_Text::updateParagraphStyles() -{ - textWidgets->updateParagraphStyles(); - parEffectWidgets->updateCharStyles(); -} - void PropertiesPalette_Text::updateTextStyles() { - textWidgets->updateTextStyles(); + styleWidgets->updateTextStyles(); + parEffectWidgets->updateTextStyles(); } void PropertiesPalette_Text::showAlignment(int e) { - textWidgets->showAlignment(e); + alignmentWidgets->showAlignment(e); } void PropertiesPalette_Text::showDirection(int e) { - textWidgets->showDirection(e); + alignmentWidgets->showDirection(e); } -void PropertiesPalette_Text::updateColorList() -{ - if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - - colorWidgets->updateColorList(); -} - void PropertiesPalette_Text::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) @@ -497,46 +421,23 @@ void PropertiesPalette_Text::languageChange() { - scAdvanced->setText(tr("Advanced Settings")); - scDistance->setText(tr("Columns && Text Distances")); - scFlop->setText(tr("First Line Offset")); - scFontFeatures->setText(tr("Font Features")); - scHyphenation->setText(tr("Hyphenation")); - scOptMargins->setText(tr("Optical Margins")); - scOrphans->setText(tr("Orphans and Widows")); - scParEffect->setText(tr("Paragraph Effects")); - scPathText->setText(tr("Path Text Properties")); - scText->setText(tr("Text")); - scTextColor->setText(tr("Color && Effects")); + scAdvanced->setText(tr("Typography")); + scAlignment->setText(tr("Alignment && Tabs")); + scDistance->setText(tr("Columns && Margins")); + scFontFeatures->setText(tr("OpenType Features")); + scHyphenation->setText(tr("Hyphenation && Language")); + scOrphans->setText(tr("Orphans && Widows")); + scParEffect->setText(tr("Lists && Drop Caps")); + scPathText->setText(tr("Text on Path")); + scText->setText(tr("Font")); - colorWidgets->languageChange(); - flopBox->languageChange(); orphanBox->languageChange(); distanceWidgets->languageChange(); - optMargins->languageChange(); advancedWidgets->languageChange(); + alignmentWidgets->languageChange(); pathTextWidgets->languageChange(); fontfeaturesWidget->languageChange(); hyphenationWidget->languageChange(); textWidgets->languageChange(); + styleWidgets->languageChange(); } - -void PropertiesPalette_Text::handleFirstLinePolicy(int radioFlop) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveDoc || !m_haveItem) - return; - if (radioFlop == PropertyWidget_Flop::RealHeightID) - m_item->setFirstLineOffset(FLOPRealGlyphHeight); - else if (radioFlop == PropertyWidget_Flop::FontAscentID) - m_item->setFirstLineOffset(FLOPFontAscent); - else if (radioFlop == PropertyWidget_Flop::LineSpacingID) - m_item->setFirstLineOffset(FLOPLineSpacing); - else if (radioFlop == PropertyWidget_Flop::BaselineGridID) - m_item->setFirstLineOffset(FLOPBaselineGrid); - m_item->update(); - if (m_doc->appMode == modeEditTable) - m_item->parentTable()->update(); - else - m_item->update(); - m_doc->regionsChanged()->update(QRect()); -} Index: scribus/ui/propertiespalette_text.h =================================================================== --- scribus/ui/propertiespalette_text.h (Revision 26320) +++ scribus/ui/propertiespalette_text.h (Arbeitskopie) @@ -7,10 +7,8 @@ #ifndef PROPERTIESPALETTE_TEXT_H #define PROPERTIESPALETTE_TEXT_H +#include <QWidget> #include "scribusapi.h" -#include "scrpalettebase.h" -#include "scrspinbox.h" - #include "scguardedptr.h" #include "sctextstruct.h" #include "units.h" @@ -17,22 +15,21 @@ class PageItem; class PropertyWidget_Advanced; +class PropertyWidget_Alignment; class PropertyWidget_Distance; +class PropertyWidget_ParagraphStyle; class PropertyWidget_ParEffect; -class PropertyWidget_Flop; class PropertyWidget_FontFeatures; class PropertyWidget_Hyphenation; -class PropertyWidget_OptMargins; class PropertyWidget_Orphans; class PropertyWidget_PathText; -class PropertyWidget_Text; -class PropertyWidget_TextColor; -class SectionContainer; +class PropertyWidget_Text; +class SectionContainer; class ScribusDoc; class ScribusMainWindow; class Selection; -class SCRIBUS_API PropertiesPalette_Text : public QWidget +class SCRIBUS_API PropertiesPalette_Text : public QWidget { Q_OBJECT @@ -40,7 +37,7 @@ PropertiesPalette_Text(QWidget* parent); ~PropertiesPalette_Text() {} - void updateColorList(); + //void updateColorList(); /** @brief Returns true if there is a user action going on at the moment of call. */ bool userActionOn(); // not yet implemented!!! This is needed badly. @@ -81,43 +78,35 @@ void showDirection(int e); void showFontSize(double s); void showLanguage(const QString& w); - void showFirstLinePolicy(FirstLineOffsetPolicy); - + /// update TB values: void updateCharStyle(const CharStyle& charStyle); - void updateStyle(const ParagraphStyle& newCurrent); - void updateCharStyles(); - void updateParagraphStyles(); - void updateTextStyles(); + void updateParagraphStyle(const ParagraphStyle& newCurrent); + void updateTextStyles(); -private slots: - - void handleFirstLinePolicy(int); - protected: PropertyWidget_Advanced* advancedWidgets; + PropertyWidget_Alignment* alignmentWidgets; PropertyWidget_Distance* distanceWidgets; - PropertyWidget_Flop* flopBox; PropertyWidget_FontFeatures* fontfeaturesWidget; PropertyWidget_Hyphenation* hyphenationWidget; - PropertyWidget_OptMargins* optMargins; PropertyWidget_Orphans* orphanBox; + PropertyWidget_ParagraphStyle* styleWidgets; PropertyWidget_ParEffect* parEffectWidgets; PropertyWidget_PathText* pathTextWidgets; - PropertyWidget_Text* textWidgets; - PropertyWidget_TextColor* colorWidgets; + PropertyWidget_Text* textWidgets; - SectionContainer * scAdvanced = {nullptr}; - SectionContainer * scDistance = {nullptr}; - SectionContainer * scFlop = {nullptr}; - SectionContainer * scFontFeatures = {nullptr}; - SectionContainer * scHyphenation = {nullptr}; - SectionContainer * scOptMargins = {nullptr}; - SectionContainer * scOrphans = {nullptr}; - SectionContainer * scParEffect = {nullptr}; - SectionContainer * scPathText = {nullptr}; - SectionContainer * scText = {nullptr}; - SectionContainer * scTextColor = {nullptr}; + SectionContainer * scStyles= {nullptr}; + SectionContainer * scAdvanced = {nullptr}; + SectionContainer * scAlignment = {nullptr}; + SectionContainer * scDistance = {nullptr}; + SectionContainer * scFontFeatures = {nullptr}; + SectionContainer * scHyphenation = {nullptr}; + SectionContainer * scOrphans = {nullptr}; + SectionContainer * scParEffect = {nullptr}; + SectionContainer * scPathText = {nullptr}; + SectionContainer * scText = {nullptr}; + SectionContainer * scTextColor = {nullptr}; }; Index: scribus/ui/propertywidget_advanced.cpp =================================================================== --- scribus/ui/propertywidget_advanced.cpp (Revision 26320) +++ scribus/ui/propertywidget_advanced.cpp (Arbeitskopie) @@ -27,17 +27,12 @@ scaleH->setValues(10, 400, 2, 100); scaleV->setValues(10, 400, 2, 100); - minWordTrackingLabel->setBuddy(minWordTrackingSpinBox); - normWordTrackingLabel->setBuddy(normWordTrackingSpinBox); - - minGlyphExtensionLabel->setBuddy(minGlyphExtSpinBox); - maxGlyphExtensionLabel->setBuddy(maxGlyphExtSpinBox); - iconSetChange(); languageChange(); connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void PropertyWidget_Advanced::setMainWindow(ScribusMainWindow *mw) @@ -120,6 +115,15 @@ connect(normWordTrackingSpinBox, SIGNAL(valueChanged(double)), this, SLOT(handleNormWordTracking()) ); connect(minGlyphExtSpinBox , SIGNAL(valueChanged(double)), this, SLOT(handleMinGlyphExtension()) ); connect(maxGlyphExtSpinBox , SIGNAL(valueChanged(double)), this, SLOT(handleMaxGlyphExtension()) ); + + connect(textEffects, SIGNAL(State(int)) , this, SLOT(handleTypeStyle(int)), Qt::UniqueConnection); + connect(textEffects->ShadowVal->Xoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs()), Qt::UniqueConnection); + connect(textEffects->ShadowVal->Yoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs()), Qt::UniqueConnection); + connect(textEffects->OutlineVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleOutlineWidth()), Qt::UniqueConnection); + connect(textEffects->UnderlineVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleUnderline()) , Qt::UniqueConnection); + connect(textEffects->UnderlineVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleUnderline()) , Qt::UniqueConnection); + connect(textEffects->StrikeVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru()), Qt::UniqueConnection); + connect(textEffects->StrikeVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru()), Qt::UniqueConnection); } void PropertyWidget_Advanced::disconnectSignals() @@ -132,6 +136,15 @@ disconnect(normWordTrackingSpinBox, SIGNAL(valueChanged(double)), this, SLOT(handleNormWordTracking()) ); disconnect(minGlyphExtSpinBox , SIGNAL(valueChanged(double)), this, SLOT(handleMinGlyphExtension()) ); disconnect(maxGlyphExtSpinBox , SIGNAL(valueChanged(double)), this, SLOT(handleMaxGlyphExtension()) ); + + disconnect(textEffects, SIGNAL(State(int)) , this, SLOT(handleTypeStyle(int))); + disconnect(textEffects->ShadowVal->Xoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs())); + disconnect(textEffects->ShadowVal->Yoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs())); + disconnect(textEffects->OutlineVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleOutlineWidth())); + disconnect(textEffects->UnderlineVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleUnderline())); + disconnect(textEffects->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(handleUnderline())); + disconnect(textEffects->StrikeVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru())); + disconnect(textEffects->StrikeVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru())); } void PropertyWidget_Advanced::configureWidgets() @@ -189,6 +202,45 @@ tracking->showValue(e / 10.0); } +void PropertyWidget_Advanced::showOutlineW(double x) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + textEffects->OutlineVal->LWidth->showValue(x / 10.0); +} + +void PropertyWidget_Advanced::showShadowOffset(double x, double y) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + textEffects->ShadowVal->Xoffset->showValue(x / 10.0); + textEffects->ShadowVal->Yoffset->showValue(y / 10.0); +} + +void PropertyWidget_Advanced::showStrikeThru(double p, double w) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + textEffects->StrikeVal->LPos->showValue(p / 10.0); + textEffects->StrikeVal->LWidth->showValue(w / 10.0); +} + +void PropertyWidget_Advanced::showTextEffects(int s) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + + textEffects->setStyle(s); +} + +void PropertyWidget_Advanced::showUnderline(double p, double w) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + textEffects->UnderlineVal->LPos->showValue(p / 10.0); + textEffects->UnderlineVal->LWidth->showValue(w / 10.0); +} + void PropertyWidget_Advanced::handleBaselineOffset() { if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) @@ -317,6 +369,90 @@ } } +void PropertyWidget_Advanced::handleUnderline() +{ + if ((m_doc) && (m_item)) + { + int x = qRound(textEffects->UnderlineVal->LPos->value() * 10.0); + int y = qRound(textEffects->UnderlineVal->LWidth->value() * 10.0); + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_doc->itemSelection_SetUnderline(x, y, &tempSelection); + } + } +} + +void PropertyWidget_Advanced::handleOutlineWidth() +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + int x = qRound(textEffects->OutlineVal->LWidth->value() * 10.0); + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_doc->itemSelection_SetOutlineWidth(x, &tempSelection); + } +} + +void PropertyWidget_Advanced::handleShadowOffs() +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + int x = qRound(textEffects->ShadowVal->Xoffset->value() * 10.0); + int y = qRound(textEffects->ShadowVal->Yoffset->value() * 10.0); + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_doc->itemSelection_SetShadowOffsets(x, y, &tempSelection); + } +} + +void PropertyWidget_Advanced::handleTypeStyle(int s) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_doc->itemSelection_SetEffects(s, &tempSelection); + m_ScMW->setStyleEffects(s); + } +} + +void PropertyWidget_Advanced::handleStrikeThru() +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + int x = qRound(textEffects->StrikeVal->LPos->value() * 10.0); + int y = qRound(textEffects->StrikeVal->LWidth->value() * 10.0); + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_doc->itemSelection_SetStrikethru(x, y, &tempSelection); + } +} + void PropertyWidget_Advanced::updateCharStyle(const CharStyle& charStyle) { if (!m_ScMW || m_ScMW->scriptIsRunning()) @@ -326,6 +462,11 @@ showTextScaleV(charStyle.scaleV()); showTracking(charStyle.tracking()); showBaseLineOffset(charStyle.baselineOffset()); + showOutlineW(charStyle.outlineWidth()); + showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset()); + showTextEffects(charStyle.effects()); + showStrikeThru(charStyle.strikethruOffset(), charStyle.strikethruWidth()); + showUnderline(charStyle.underlineOffset(), charStyle.underlineWidth()); normWordTrackingSpinBox->showValue(charStyle.wordTracking() * 100.0); } @@ -341,6 +482,11 @@ showTextScaleV(charStyle.scaleV()); showTracking(charStyle.tracking()); showBaseLineOffset(charStyle.baselineOffset()); + showOutlineW(charStyle.outlineWidth()); + showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset()); + showTextEffects(charStyle.effects()); + showStrikeThru(charStyle.strikethruOffset(), charStyle.strikethruWidth()); + showUnderline(charStyle.underlineOffset(), charStyle.underlineWidth()); minWordTrackingSpinBox->showValue(newCurrent.minWordTracking() * 100.0); normWordTrackingSpinBox->showValue(newCurrent.charStyle().wordTracking() * 100.0); @@ -360,16 +506,27 @@ void PropertyWidget_Advanced::iconSetChange() { - textBaseLabel->setPixmap(IconManager::instance().loadPixmap("textbase.png")); - trackingLabel->setPixmap(IconManager::instance().loadPixmap("textkern.png")); + IconManager &im = IconManager::instance(); - scaleHLabel->setPixmap(IconManager::instance().loadPixmap("textscaleh.png")); - scaleVLabel->setPixmap(IconManager::instance().loadPixmap("textscalev.png")); + textBaseLabel->setPixmap(im.loadPixmap("character-offset-baseline")); + trackingLabel->setPixmap(im.loadPixmap("character-letter-tracking")); + + scaleHLabel->setPixmap(im.loadPixmap("character-scale-width")); + scaleVLabel->setPixmap(im.loadPixmap("character-scale-height")); + + minWordTrackingLabel->setPixmap(im.loadPixmap("character-space-width-min")); + normWordTrackingLabel->setPixmap(im.loadPixmap("character-space-width")); + + minGlyphExtensionLabel->setPixmap(im.loadPixmap("character-scale-width-min")); + maxGlyphExtensionLabel->setPixmap(im.loadPixmap("character-scale-width-max")); + } void PropertyWidget_Advanced::languageChange() { retranslateUi(this); + + textEffects->languageChange(); } void PropertyWidget_Advanced::localeChange() @@ -383,4 +540,23 @@ normWordTrackingSpinBox->setLocale(l); minGlyphExtSpinBox->setLocale(l); maxGlyphExtSpinBox->setLocale(l); + + textEffects->ShadowVal->Xoffset->setLocale(l); + textEffects->ShadowVal->Yoffset->setLocale(l); + textEffects->OutlineVal->LWidth->setLocale(l); + textEffects->UnderlineVal->LPos->setLocale(l); + textEffects->UnderlineVal->LWidth->setLocale(l); + textEffects->StrikeVal->LPos->setLocale(l); + textEffects->StrikeVal->LWidth->setLocale(l); } + +void PropertyWidget_Advanced::toggleLabelVisibility(bool v) +{ + minWordTrackingLabel->setLabelVisibility(v); + normWordTrackingLabel->setLabelVisibility(v); + minGlyphExtensionLabel->setLabelVisibility(v); + maxGlyphExtensionLabel->setLabelVisibility(v); + glyphLabel->setLabelVisibility(v); + spaceLabel->setLabelVisibility(v); + +} Index: scribus/ui/propertywidget_advanced.h =================================================================== --- scribus/ui/propertywidget_advanced.h (Revision 26320) +++ scribus/ui/propertywidget_advanced.h (Arbeitskopie) @@ -32,6 +32,7 @@ double m_unitRatio {1.0}; int m_unitIndex {SC_PT}; + bool m_blockUpdate {false}; PageItem *m_item {nullptr}; ScribusMainWindow* m_ScMW {nullptr}; @@ -50,6 +51,7 @@ void languageChange(); void unitChange() {}; void localeChange(); + void toggleLabelVisibility(bool v); void showBaseLineOffset(double e); void showTextScaleH(double e); @@ -56,6 +58,12 @@ void showTextScaleV(double e); void showTracking(double e); + void showOutlineW(double x); + void showShadowOffset(double x, double y); + void showStrikeThru(double p, double w); + void showTextEffects(int s); + void showUnderline(double p, double w); + void updateCharStyle(const CharStyle& charStyle); void updateStyle(const ParagraphStyle& newCurrent); @@ -69,6 +77,12 @@ void handleTextScaleV(); void handleTracking(); + void handleOutlineWidth(); + void handleShadowOffs(); + void handleStrikeThru(); + void handleTypeStyle(int s); + void handleUnderline(); + }; #endif Index: scribus/ui/propertywidget_distance.cpp =================================================================== --- scribus/ui/propertywidget_distance.cpp (Revision 26320) +++ scribus/ui/propertywidget_distance.cpp (Arbeitskopie) @@ -11,6 +11,7 @@ #include "appmodehelper.h" #include "appmodes.h" +#include "iconmanager.h" #include "localemgr.h" #include "pageitem_table.h" #include "pageitem_textframe.h" @@ -26,29 +27,24 @@ layout()->setAlignment(Qt::AlignTop); - columnsLabel->setBuddy(columns); columnGap->setValues(0, 300, 2, 0); + columns->setDecimals(0); + columns->setSuffix(""); - topDistance->setValues(0, 300, 2, 0); - topLabel->setBuddy(topDistance); + MarginStruct distances; + distances.resetToZero(); - bottomDistance->setValues(0, 300, 2, 0); - bottomLabel->setBuddy(bottomDistance); + distanceWidget->setup(distances, 0, m_unitIndex, NewMarginWidget::DistanceWidgetFlags); + distanceWidget->toggleLabelVisibility(false); - leftDistance->setValues(0, 300, 2, 0); - leftLabel->setBuddy(leftDistance); - - rightDistance->setValues(0, 300, 2, 0); - rightLabel->setBuddy(rightDistance); - - columns->setDecimals(0); - columns->setSuffix(""); - + iconSetChange(); languageChange(); - columnGapLabel->setCurrentIndex(0); + columnGapCombo->setCurrentIndex(0); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void PropertyWidget_Distance::setMainWindow(ScribusMainWindow* mw) @@ -84,10 +80,6 @@ columns->setDecimals(0); columnGap->setDecimals(2); - topDistance->setDecimals(2); - leftDistance->setDecimals(2); - bottomDistance->setDecimals(2); - rightDistance->setDecimals(2); connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); connect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); @@ -119,11 +111,15 @@ textItem = m_item->asTable()->activeCell().textFrame(); if (!textItem) return; + ParagraphStyle parStyle = m_item->itemText.defaultStyle(); + if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable) + m_item->currentTextProps(parStyle); + //#14427: columns->setMaximum(qMax(qRound(textItem->width() / qMax(textItem->ColGap, 10.0)), 1)); columns->setMinimum(1); columns->setValue(textItem->m_columns); columnGap->setMinimum(0); - if (columnGapLabel->currentIndex() == 0) + if (columnGapCombo->currentIndex() == 0) { columnGap->setMaximum(qMax((textItem->width() / textItem->m_columns - textItem->textToFrameDistLeft() - textItem->textToFrameDistRight()) * m_unitRatio, 0.0)); columnGap->setValue(textItem->m_columnGap * m_unitRatio); @@ -133,23 +129,21 @@ columnGap->setMaximum(qMax((textItem->width() / textItem->m_columns) * m_unitRatio, 0.0)); columnGap->setValue(textItem->columnWidth() * m_unitRatio); } - leftDistance->setValue(textItem->textToFrameDistLeft()*m_unitRatio); - topDistance->setValue(textItem->textToFrameDistTop()*m_unitRatio); - bottomDistance->setValue(textItem->textToFrameDistBottom()*m_unitRatio); - rightDistance->setValue(textItem->textToFrameDistRight()*m_unitRatio); - if (columns->value() == 1) - { - columnGap->setEnabled(false); - columnGapLabel->setEnabled(false); - } - else - { - columnGap->setEnabled(true); - columnGapLabel->setEnabled(true); - } - showTextDistances(textItem->textToFrameDistLeft(), textItem->textToFrameDistTop(), textItem->textToFrameDistBottom(), textItem->textToFrameDistRight()); - verticalAlign->setCurrentIndex(textItem->verticalAlignment()); + MarginStruct distances; + distances.set( + textItem->textToFrameDistTop(), + textItem->textToFrameDistLeft(), + textItem->textToFrameDistBottom(), + textItem->textToFrameDistRight() + ); + distanceWidget->setPageHeight(m_item->height()); + distanceWidget->setPageWidth(m_item->width()); + distanceWidget->setNewValues(distances); + + columnGapLabel->setVisible(columns->value() != 1); + columnGapSizeLabel->setVisible(columns->value() != 1); + connectSignals(); } @@ -157,13 +151,8 @@ { connect(columns , SIGNAL(valueChanged(double)) , this, SLOT(handleColumns()), Qt::UniqueConnection); connect(columnGap , SIGNAL(valueChanged(double)), this, SLOT(handleColumnGap()), Qt::UniqueConnection); - connect(columnGapLabel, SIGNAL(activated(int)) , this, SLOT(handleGapSwitch()), Qt::UniqueConnection); - connect(topDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); - connect(leftDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); - connect(rightDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); - connect(bottomDistance, SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); - connect(tabsButton , SIGNAL(clicked()) , this, SLOT(handleTabs()), Qt::UniqueConnection); - connect(verticalAlign , SIGNAL(activated(int)) , this, SLOT(handleVAlign()), Qt::UniqueConnection); + connect(columnGapCombo, SIGNAL(activated(int)) , this, SLOT(handleGapSwitch()), Qt::UniqueConnection); + connect(distanceWidget, SIGNAL(valuesChanged(MarginStruct)), this, SLOT(handleTextDistances()), Qt::UniqueConnection); } void PropertyWidget_Distance::disconnectSignals() @@ -170,13 +159,8 @@ { disconnect(columns , SIGNAL(valueChanged(double)) , this, SLOT(handleColumns())); disconnect(columnGap , SIGNAL(valueChanged(double)), this, SLOT(handleColumnGap())); - disconnect(columnGapLabel, SIGNAL(activated(int)) , this, SLOT(handleGapSwitch())); - disconnect(topDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances())); - disconnect(leftDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances())); - disconnect(rightDistance , SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances())); - disconnect(bottomDistance, SIGNAL(valueChanged(double)), this, SLOT(handleTextDistances())); - disconnect(tabsButton , SIGNAL(clicked()) , this, SLOT(handleTabs())); - disconnect(verticalAlign , SIGNAL(activated(int)) , this, SLOT(handleVAlign())); + disconnect(columnGapCombo, SIGNAL(activated(int)) , this, SLOT(handleGapSwitch())); + disconnect(distanceWidget, SIGNAL(valuesChanged(MarginStruct)), this, SLOT(handleTextDistances())); } void PropertyWidget_Distance::configureWidgets() @@ -195,8 +179,8 @@ { int numCols = textItem->m_columns; - columnGap->setEnabled(numCols != 1); - columnGapLabel->setEnabled(numCols != 1); + columnGapLabel->setVisible(numCols != 1); + columnGapSizeLabel->setVisible(numCols != 1); } } setEnabled(enabled); @@ -225,6 +209,13 @@ // Nothing to do in this widget } +void PropertyWidget_Distance::iconSetChange() +{ + IconManager &im = IconManager::instance(); + + columnsLabel->setPixmap(im.loadPixmap("paragraph-columns")); +} + void PropertyWidget_Distance::showColumns(int r, double g) { if (!m_ScMW || m_ScMW->scriptIsRunning()) @@ -244,7 +235,7 @@ if (textItem != nullptr) { //#14427: columns->setMaximum(qMax(qRound(textItem->width() / qMax(textItem->ColGap, 10.0)), 1)); - if (columnGapLabel->currentIndex() == 0) + if (columnGapCombo->currentIndex() == 0) { columnGap->setMaximum(qMax((textItem->width() / textItem->m_columns - textItem->textToFrameDistLeft() - textItem->textToFrameDistRight()) * m_unitRatio, 0.0)); columnGap->setValue(textItem->m_columnGap * m_unitRatio); @@ -258,21 +249,13 @@ } columns->setMinimum(1); columnGap->setMinimum(0); - columnGap->setEnabled(columns->value() != 1); - columnGapLabel->setEnabled(columns->value() != 1); + columnGapLabel->setVisible(columns->value() != 1); + columnGapSizeLabel->setVisible(columns->value() != 1); columns->blockSignals(cSigWasBlocked); columnGap->blockSignals(cGapSigWasBlocked); } -void PropertyWidget_Distance::showTextDistances(double left, double top, double bottom, double right) -{ - leftDistance->showValue(left * m_unitRatio); - topDistance->showValue(top * m_unitRatio); - bottomDistance->showValue(bottom * m_unitRatio); - rightDistance->showValue(right * m_unitRatio); -} - void PropertyWidget_Distance::handleColumns() { if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) @@ -304,7 +287,7 @@ if (!textItem) return; - if (columnGapLabel->currentIndex() == 0) + if (columnGapCombo->currentIndex() == 0) textItem->setColumnGap(columnGap->value() / m_unitRatio); else { @@ -331,27 +314,10 @@ if (textItem != nullptr) showColumns(textItem->m_columns, textItem->m_columnGap); - int index = columnGapLabel->currentIndex(); + int index = columnGapCombo->currentIndex(); columnGap->setToolTip((index == 0) ? tr( "Distance between columns" ) : tr( "Column width" )); } -void PropertyWidget_Distance::handleVAlign() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *textItem = m_item; - if (m_doc->appMode == modeEditTable) - textItem = m_item->asTable()->activeCell().textFrame(); - if (textItem != nullptr) - { - textItem->setVerticalAlignment(verticalAlign->currentIndex()); - textItem->update(); - if (m_doc->appMode == modeEditTable) - m_item->asTable()->update(); - m_doc->regionsChanged()->update(QRect()); - } -} - void PropertyWidget_Distance::handleTabs() { if (!m_doc || !m_item) @@ -393,10 +359,10 @@ textItem = m_item->asTable()->activeCell().textFrame(); if (!textItem) return; - double left = leftDistance->value() / m_unitRatio; - double right = rightDistance->value() / m_unitRatio; - double top = topDistance->value() / m_unitRatio; - double bottom = bottomDistance->value() / m_unitRatio; + double left = distanceWidget->margins().left(); + double right = distanceWidget->margins().right(); + double top = distanceWidget->margins().top(); + double bottom = distanceWidget->margins().bottom(); textItem->setTextToFrameDist(left, right, top, bottom); showColumns(textItem->m_columns, textItem->m_columnGap); @@ -420,30 +386,18 @@ { retranslateUi(this); - QSignalBlocker verticalAlignBlocker(verticalAlign); - int oldAlignIndex = verticalAlign->currentIndex(); - verticalAlign->clear(); - verticalAlign->addItem( tr("Top")); - verticalAlign->addItem( tr("Middle")); - verticalAlign->addItem( tr("Bottom")); - verticalAlign->setCurrentIndex(oldAlignIndex); + QSignalBlocker columnGapLabelBlocker(columnGapCombo); + int oldColGapLabel = columnGapCombo->currentIndex(); + columnGapCombo->clear(); + columnGapCombo->addItem( tr("Gap:")); + columnGapCombo->addItem( tr("Width:")); + columnGapCombo->setCurrentIndex(oldColGapLabel); - QSignalBlocker columnGapLabelBlocker(columnGapLabel); - int oldColGapLabel = columnGapLabel->currentIndex(); - columnGapLabel->clear(); - columnGapLabel->addItem( tr("Gap:")); - columnGapLabel->addItem( tr("Width:")); - columnGapLabel->setCurrentIndex(oldColGapLabel); - QString ptSuffix = tr(" pt"); - QString suffix = (m_doc) ? unitGetSuffixFromIndex(m_doc->unitIndex()) : ptSuffix; columnGap->setSuffix(suffix); - leftDistance->setSuffix(suffix); - topDistance->setSuffix(suffix); - bottomDistance->setSuffix(suffix); - rightDistance->setSuffix(suffix); + } void PropertyWidget_Distance::unitChange() @@ -452,19 +406,13 @@ return; QSignalBlocker columnGapBlocker(columnGap); - QSignalBlocker leftDistanceBlocker(leftDistance); - QSignalBlocker topDistanceBlocker(topDistance); - QSignalBlocker bottomDistanceBlocker(bottomDistance); - QSignalBlocker rightDistanceBlocker(rightDistance); + QSignalBlocker distancesBlocker(distanceWidget); m_unitRatio = m_doc->unitRatio(); m_unitIndex = m_doc->unitIndex(); columnGap->setNewUnit(m_unitIndex); - leftDistance->setNewUnit(m_unitIndex); - topDistance->setNewUnit(m_unitIndex); - bottomDistance->setNewUnit(m_unitIndex); - rightDistance->setNewUnit(m_unitIndex); + distanceWidget->setNewUnit(m_unitIndex); } void PropertyWidget_Distance::localeChange() @@ -471,8 +419,12 @@ { const QLocale& l(LocaleManager::instance().userPreferredLocale()); columnGap->setLocale(l); - topDistance->setLocale(l); - bottomDistance->setLocale(l); - leftDistance->setLocale(l); - rightDistance->setLocale(l); + distanceWidget->setLocale(l); } + +void PropertyWidget_Distance::toggleLabelVisibility(bool v) +{ + columnGapSizeLabel->setLabelVisibility(v); + columnGapLabel->setLabelVisibility(v); + columnsLabel->setLabelVisibility(v); +} Index: scribus/ui/propertywidget_distance.h =================================================================== --- scribus/ui/propertywidget_distance.h (Revision 26320) +++ scribus/ui/propertywidget_distance.h (Arbeitskopie) @@ -46,12 +46,13 @@ void handleSelectionChanged(); void handleUpdateRequest(int); + void iconSetChange(); void languageChange(); void unitChange(); void localeChange(); + void toggleLabelVisibility(bool v); void showColumns(int r, double g); - void showTextDistances(double left, double top, double bottom, double right); private slots: void handleColumns(); @@ -58,7 +59,6 @@ void handleColumnGap(); void handleGapSwitch(); void handleTabs(); - void handleVAlign(); void handleTextDistances(); }; Index: scribus/ui/propertywidget_flop.cpp =================================================================== --- scribus/ui/propertywidget_flop.cpp (Revision 26320) +++ scribus/ui/propertywidget_flop.cpp (nicht existent) @@ -1,52 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ - -#include "propertywidget_flop.h" - -#include "scribusdoc.h" - -PropertyWidget_Flop::PropertyWidget_Flop(QWidget* parent) : QFrame(parent) -{ - setupUi(this); - - layout()->setAlignment(Qt::AlignTop); - - flopRealHeight->setChecked(true); - - flopGroup->setId(flopRealHeight, RealHeightID); - flopGroup->setId(flopFontAscent, FontAscentID); - flopGroup->setId(flopLineSpacing, LineSpacingID); - flopGroup->setId(flopBaselineGrid, BaselineGridID); - - languageChange(); -} - -void PropertyWidget_Flop::setDoc(ScribusDoc *d) -{ - if (d == (ScribusDoc*) m_doc) - return; - - m_doc = d; - - if (m_doc.isNull()) - return; -} - -void PropertyWidget_Flop::changeEvent(QEvent *e) -{ - if (e->type() == QEvent::LanguageChange) - { - languageChange(); - return; - } - QWidget::changeEvent(e); -} - -void PropertyWidget_Flop::languageChange() -{ - retranslateUi(this); -} Index: scribus/ui/propertywidget_flop.h =================================================================== --- scribus/ui/propertywidget_flop.h (Revision 26320) +++ scribus/ui/propertywidget_flop.h (nicht existent) @@ -1,46 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ -#ifndef PROPERTYWIDGET_FLOP_H -#define PROPERTYWIDGET_FLOP_H - -#include "ui_propertywidget_flopbase.h" - -#include "scguardedptr.h" - -class ScribusDoc; - -class PropertyWidget_Flop : public QFrame, public Ui::PropertyWidget_FlopBase -{ - Q_OBJECT - -public: - - enum FlopButtonID - { - RealHeightID = 0, - FontAscentID = 1, - LineSpacingID = 2, - BaselineGridID = 3 - }; - - PropertyWidget_Flop(QWidget* parent); - ~PropertyWidget_Flop() {}; - -protected: - ScGuardedPtr<ScribusDoc> m_doc; - - void changeEvent(QEvent *e) override; - -public slots: - - void setDoc(ScribusDoc *d); - - void languageChange(); - void unitChange() {}; -}; - -#endif Index: scribus/ui/propertywidget_flopbase.ui =================================================================== --- scribus/ui/propertywidget_flopbase.ui (Revision 26320) +++ scribus/ui/propertywidget_flopbase.ui (nicht existent) @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>PropertyWidget_FlopBase</class> - <widget class="QFrame" name="PropertyWidget_FlopBase"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>218</width> - <height>107</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>3</number> - </property> - <property name="topMargin"> - <number>3</number> - </property> - <property name="rightMargin"> - <number>3</number> - </property> - <property name="bottomMargin"> - <number>3</number> - </property> - <item> - <widget class="QRadioButton" name="flopRealHeight"> - <property name="toolTip"> - <string>Set the height of the first line of the text frame to use the tallest height of the included characters</string> - </property> - <property name="text"> - <string>Maximum Ascent</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">flopGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="flopFontAscent"> - <property name="toolTip"> - <string>Set the height of the first line of text frame to use the full ascent of the font(s) in use</string> - </property> - <property name="text"> - <string>Font Ascent</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">flopGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="flopLineSpacing"> - <property name="toolTip"> - <string>Set the height of the first line of the text frame to the specified line height</string> - </property> - <property name="text"> - <string>Line Spacing</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">flopGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="flopBaselineGrid"> - <property name="toolTip"> - <string>Set the base line of the first line of the text frame to the base line grid</string> - </property> - <property name="text"> - <string>Baseline Grid</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">flopGroup</string> - </attribute> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> - <buttongroups> - <buttongroup name="flopGroup"/> - </buttongroups> -</ui> Index: scribus/ui/propertywidget_fontfeatures.cpp =================================================================== --- scribus/ui/propertywidget_fontfeatures.cpp (Revision 26320) +++ scribus/ui/propertywidget_fontfeatures.cpp (Arbeitskopie) @@ -4,15 +4,22 @@ a copyright and/or license notice that predates the release of Scribus 1.3.2 for which a new license (GPL+exception) is in place. */ + +#include <QButtonGroup> + #include "propertywidget_fontfeatures.h" +#include "iconmanager.h" +#include "localemgr.h" #include "appmodes.h" #include "pageitem_table.h" #include "scribus.h" +#include "scribusapp.h" #include "scribusdoc.h" #include "selection.h" #include "fonts/fontfeatures.h" + PropertyWidget_FontFeatures::PropertyWidget_FontFeatures(QWidget* parent) : QFrame(parent) { setupUi(this); @@ -20,7 +27,13 @@ layout()->setAlignment(Qt::AlignTop); initWidgets(); + iconSetChange(); languageChange(); + localeChange(); + + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void PropertyWidget_FontFeatures::setMainWindow(ScribusMainWindow *mw) @@ -38,11 +51,67 @@ QWidget::changeEvent(e); } +bool PropertyWidget_FontFeatures::eventFilter(QObject *obj, QEvent *e) +{ + if (e->type() == QEvent::Enter) + { + handleFontPreview(obj); + return true; + } + if (e->type() == QEvent::Leave) + { + fontPreview->setPixmap(QPixmap()); + return true; + } + + return QWidget::eventFilter(obj, e); +} + + +void PropertyWidget_FontFeatures::iconSetChange() +{ + IconManager& im = IconManager::instance(); + + // Literal Cases + SmallRadio->setIcon(im.loadIcon("ff-smcp")); + SmallFromCRadio->setIcon(im.loadIcon("ff-c2sc")); + AllSmallCapsRadio->setIcon(im.loadIcon("ff-c2sc-smcp")); + PetiteRadio->setIcon(im.loadIcon("ff-pcap")); + PetiteCapRadio->setIcon(im.loadIcon("ff-p2pc")); + AllPetiteCapsRadio->setIcon(im.loadIcon("ff-p2pc-pcap")); + UnicaseRadio->setIcon(im.loadIcon("ff-unic")); + TitlingRadio->setIcon(im.loadIcon("ff-titl")); + // Number Style + LiningRadio->setIcon(im.loadIcon("ff-lnum")); + OldStyleRadio->setIcon(im.loadIcon("ff-onum")); + // Number Width + ProportionalRadio->setIcon(im.loadIcon("ff-pnum")); + TabularRadio->setIcon(im.loadIcon("ff-tnum")); + // Number Fractions + DiagonalRadio->setIcon(im.loadIcon("ff-frac")); + StackedRadio->setIcon(im.loadIcon("ff-afrc")); + // Number Position + SubscriptRadio->setIcon(im.loadIcon("ff-subs")); + SuperscriptRadio->setIcon(im.loadIcon("ff-sups")); + OrdinalCheck->setIcon(im.loadIcon("ff-ordn")); + +} + void PropertyWidget_FontFeatures::languageChange() { retranslateUi(this); } +void PropertyWidget_FontFeatures::localeChange() +{ + //const QLocale& l(LocaleManager::instance().userPreferredLocale()); +} + +void PropertyWidget_FontFeatures::toggleLabelVisibility(bool v) +{ + // Nothing to do! +} + void PropertyWidget_FontFeatures::showFontFeatures(const QString& s, const QStringList& availableFeatures) { if (!m_ScMW || m_ScMW->scriptIsRunning()) @@ -81,7 +150,7 @@ if (featureFlags & FontFeatures::UnicaseCaps) UnicaseRadio->setChecked(true); if (featureFlags & FontFeatures::TiltingCaps) - TiltingRadio->setChecked(true); + TitlingRadio->setChecked(true); if (featureFlags & FontFeatures::LiningNumerals) LiningRadio->setChecked(true); @@ -183,7 +252,7 @@ font_feature << "+c2pc"; if (UnicaseRadio->isChecked()) font_feature << "+unic"; - if (TiltingRadio->isChecked()) + if (TitlingRadio->isChecked()) font_feature << "+titl"; //Numeric @@ -199,6 +268,8 @@ font_feature << "+frac"; if (StackedRadio->isChecked()) font_feature <<"+afrc"; + if (SlashedZeroCheck->isChecked()) + font_feature << "+zero"; //Position if (SubscriptRadio->isChecked()) @@ -208,9 +279,6 @@ if (OrdinalCheck->isChecked()) font_feature << "+ordn"; - if (SlashedZeroCheck->isChecked()) - font_feature << "+zero"; - // Stylistic sets if (StyleSet01->isChecked()) font_feature << "+ss01"; @@ -258,6 +326,59 @@ m_doc->itemSelection_SetFontFeatures(font_feature.join(","), &tempSelection); } +void PropertyWidget_FontFeatures::handleFontPreview(QObject *obj) +{ + IconManager& im = IconManager::instance(); + int h = 48; + + if (obj == (QObject*)CommonCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-liga", QSize(-1, h))); + else if (obj == (QObject*)ContextualCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-clig", QSize(-1, h))); + else if (obj == (QObject*)DiscretionaryCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-dlig", QSize(-1, h))); + else if (obj == (QObject*)HistoricalCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-hlig", QSize(-1, h))); + else if (obj == (QObject*)AllSmallCapsRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-c2sc-smcp", QSize(-1, h))); + else if (obj == (QObject*)SmallRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-smcp", QSize(-1, h))); + else if (obj == (QObject*)SmallFromCRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-c2sc", QSize(-1, h))); + else if (obj == (QObject*)AllPetiteCapsRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-p2pc-pcap", QSize(-1, h))); + else if (obj == (QObject*)PetiteRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-pcap", QSize(-1, h))); + else if (obj == (QObject*)PetiteCapRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-p2pc", QSize(-1, h))); + else if (obj == (QObject*)UnicaseRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-unic", QSize(-1, h))); + // else if (obj == (QObject*)TitlingRadio) + // fontPreview->setPixmap(im.loadPixmap("", QSize(-1, h))); + else if (obj == (QObject*)LiningRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-lnum", QSize(-1, h))); + else if (obj == (QObject*)OldStyleRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-onum", QSize(-1, h))); + else if (obj == (QObject*)ProportionalRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-pnum", QSize(-1, h))); + else if (obj == (QObject*)TabularRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-tnum", QSize(-1, h))); + else if (obj == (QObject*)DiagonalRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-frac", QSize(-1, h))); + else if (obj == (QObject*)StackedRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-afrc", QSize(-1, h))); + else if (obj == (QObject*)SubscriptRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-subs", QSize(-1, h))); + else if (obj == (QObject*)SuperscriptRadio) + fontPreview->setPixmap(im.loadPixmap("ff-preview-sups", QSize(-1, h))); + else if (obj == (QObject*)OrdinalCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-ordn", QSize(-1, h))); + else if (obj == (QObject*)SlashedZeroCheck) + fontPreview->setPixmap(im.loadPixmap("ff-preview-zero", QSize(-1, h))); + else + fontPreview->setPixmap(QPixmap()); +} + void PropertyWidget_FontFeatures::setDoc(ScribusDoc *d) { if ((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning())) @@ -297,6 +418,7 @@ { if (!m_ScMW || m_ScMW->scriptIsRunning()) return; + showFontFeatures(charStyle.fontFeatures(), charStyle.font().fontFeatures()); } @@ -324,7 +446,7 @@ connect(PetiteCapRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(AllPetiteCapsRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(UnicaseRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); - connect(TiltingRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); + connect(TitlingRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(DefaultStyleRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); connect(LiningRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures()), Qt::UniqueConnection); @@ -382,7 +504,7 @@ disconnect(PetiteCapRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(AllPetiteCapsRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(UnicaseRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); - disconnect(TiltingRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); + disconnect(TitlingRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(DefaultStyleRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); disconnect(LiningRadio, SIGNAL(clicked()), this, SLOT(handleFontFeatures())); @@ -468,11 +590,19 @@ disableAllFeatures(); + // Ligatures CommonCheck->setVisible(newFlags & FontFeatures::CommonLigatures); + labelCommonLigatures->setVisible(newFlags & FontFeatures::CommonLigatures); ContextualCheck->setVisible(newFlags & FontFeatures::ContextualLigatures); + labelContextualLigatures->setVisible(newFlags & FontFeatures::ContextualLigatures); DiscretionaryCheck->setVisible(newFlags & FontFeatures::DiscretionaryLigatures); + labelDiscretionaryLigatures->setVisible(newFlags & FontFeatures::DiscretionaryLigatures); HistoricalCheck->setVisible(newFlags & FontFeatures::HistoricalLigatures); + labelHistoricalLigatures->setVisible(newFlags & FontFeatures::HistoricalLigatures); + // Capitals + NormalCapRadio->setVisible(newFlags & FontFeatures::CapsMask); + labelCapitals->setVisible(newFlags & FontFeatures::CapsMask); SmallRadio->setVisible(newFlags & FontFeatures::SmallCaps); SmallFromCRadio->setVisible(newFlags & FontFeatures::SmallCapsFromCaps); AllSmallCapsRadio->setVisible((newFlags & FontFeatures::AllSmallCapsMask) == FontFeatures::AllSmallCapsMask); @@ -480,23 +610,38 @@ PetiteCapRadio->setVisible(newFlags & FontFeatures::PetiteCapsFromCaps); AllPetiteCapsRadio->setVisible((newFlags & FontFeatures::AllPetiteCapsMask) == FontFeatures::AllPetiteCapsMask); UnicaseRadio->setVisible(newFlags & FontFeatures::UnicaseCaps); - TiltingRadio->setVisible(newFlags & FontFeatures::TiltingCaps); + TitlingRadio->setVisible(newFlags & FontFeatures::TiltingCaps); + // Numeral Style + DefaultStyleRadio->setVisible(newFlags & FontFeatures::NumeralStyleMask); + labelNumeralStyle->setVisible(newFlags & FontFeatures::NumeralStyleMask); LiningRadio->setVisible(newFlags & FontFeatures::LiningNumerals); OldStyleRadio->setVisible(newFlags & FontFeatures::OldStyleNumerals); + // Numeral Width + DefaultWidthRadio->setVisible(newFlags & FontFeatures::NumeralWidthMask); + labelNumeralWidth->setVisible(newFlags & FontFeatures::NumeralWidthMask); ProportionalRadio->setVisible(newFlags & FontFeatures::ProportionalNumeralWidth); TabularRadio->setVisible(newFlags & FontFeatures::TabularNumeralWidth); + // Numeral Fractions + DefaultFractionsRadio->setVisible(newFlags & FontFeatures::NumeralFractionsMask); + labelFraction->setVisible(newFlags & FontFeatures::NumeralFractionsMask); DiagonalRadio->setVisible(newFlags & FontFeatures::DiagonalFractions); StackedRadio->setVisible(newFlags & FontFeatures::StackedFractions); + // Numeral Positions + DefaultPosRadio->setVisible(newFlags & FontFeatures::GlyphPositionMask); + LabelNumeralPosition->setVisible(newFlags & FontFeatures::GlyphPositionMask); SubscriptRadio->setVisible(newFlags & FontFeatures::Subscript); SuperscriptRadio->setVisible(newFlags & FontFeatures::Superscript); OrdinalCheck->setVisible(newFlags & FontFeatures::Ordinals); + // Numeral Slash Zero SlashedZeroCheck->setVisible(newFlags & FontFeatures::SlashedZero); + labelSlashedZero->setVisible(newFlags & FontFeatures::SlashedZero); + // Stylistic Sets StyleSet01->setVisible(newFlags & FontFeatures::StyleSet01); StyleSet02->setVisible(newFlags & FontFeatures::StyleSet02); StyleSet03->setVisible(newFlags & FontFeatures::StyleSet03); @@ -520,23 +665,29 @@ groupBox_7->setVisible(newFlags & FontFeatures::StyleSetsMask); - // Hide Default features when their relative ones aren't found in the font. - NormalCapRadio->setVisible(newFlags & FontFeatures::CapsMask); - DefaultStyleRadio->setVisible(newFlags & FontFeatures::NumeralStyleMask); - DefaultWidthRadio->setVisible(newFlags & FontFeatures::NumeralWidthMask); - DefaultFractionsRadio->setVisible(newFlags & FontFeatures::NumeralFractionsMask); - DefaultPosRadio->setVisible(newFlags & FontFeatures::GlyphPositionMask); + // Hide Headers + labelLigatures->setVisible(newFlags & FontFeatures::LigaturesMask); + labelLettercase->setVisible( + (newFlags & FontFeatures::CapsMask) || + (newFlags & FontFeatures::GlyphPositionMask) + ); + LabelNumbers->setVisible( + (newFlags & FontFeatures::NumeralStyleMask) || + (newFlags & FontFeatures::NumeralWidthMask) || + (newFlags & FontFeatures::NumeralFractionsMask) || + (newFlags & FontFeatures::SlashedZero) + ); + fontPreview->setVisible( + (newFlags & FontFeatures::LigaturesMask) || + (newFlags & FontFeatures::CapsMask) || + (newFlags & FontFeatures::NumeralStyleMask) || + (newFlags & FontFeatures::NumeralWidthMask) || + (newFlags & FontFeatures::NumeralFractionsMask) || + (newFlags & FontFeatures::GlyphPositionMask) || + (newFlags & FontFeatures::SlashedZero) || + (newFlags & FontFeatures::StyleSetsMask) + ); - // Hide Lines - line->setVisible(newFlags & FontFeatures::LigaturesMask); - - line_2->setVisible(newFlags & FontFeatures::CapsMask); - line_3->setVisible(newFlags & FontFeatures::NumeralStyleMask); - line_4->setVisible(newFlags & FontFeatures::NumeralWidthMask); - line_5->setVisible(newFlags & FontFeatures::NumeralFractionsMask); - line_6->setVisible(newFlags & FontFeatures::GlyphPositionMask); - line_7->setVisible(SlashedZeroCheck->isVisible()); - // Do not trigger item relayout unnecessarily, // that can hurt text typing speed if (oldFlags != featureFlags()) @@ -566,7 +717,7 @@ flags |= FontFeatures::PetiteCapsFromCaps; if (UnicaseRadio->isVisible()) flags |= FontFeatures::UnicaseCaps; - if (TiltingRadio->isVisible()) + if (TitlingRadio->isVisible()) flags |= FontFeatures::TiltingCaps; if (LiningRadio->isVisible()) @@ -657,6 +808,62 @@ void PropertyWidget_FontFeatures::initWidgets() { + fontPreview->setFixedHeight(50); + + CommonCheck->installEventFilter(this); + ContextualCheck->installEventFilter(this); + DiscretionaryCheck->installEventFilter(this); + HistoricalCheck->installEventFilter(this); + AllSmallCapsRadio->installEventFilter(this); + SmallRadio->installEventFilter(this); + SmallFromCRadio->installEventFilter(this); + AllPetiteCapsRadio->installEventFilter(this); + PetiteRadio->installEventFilter(this); + PetiteCapRadio->installEventFilter(this); + UnicaseRadio->installEventFilter(this); + TitlingRadio->installEventFilter(this); + LiningRadio->installEventFilter(this); + OldStyleRadio->installEventFilter(this); + ProportionalRadio->installEventFilter(this); + TabularRadio->installEventFilter(this); + DiagonalRadio->installEventFilter(this); + StackedRadio->installEventFilter(this); + SubscriptRadio->installEventFilter(this); + SuperscriptRadio->installEventFilter(this); + OrdinalCheck->installEventFilter(this); + SlashedZeroCheck->installEventFilter(this); + + QButtonGroup * groupCapitals = new QButtonGroup(); + groupCapitals->setExclusive(true); + groupCapitals->addButton(NormalCapRadio); + groupCapitals->addButton(SmallRadio); + groupCapitals->addButton(SmallFromCRadio); + groupCapitals->addButton(AllSmallCapsRadio); + groupCapitals->addButton(PetiteRadio); + groupCapitals->addButton(PetiteCapRadio); + groupCapitals->addButton(AllPetiteCapsRadio); + groupCapitals->addButton(UnicaseRadio); + groupCapitals->addButton(TitlingRadio); + + QButtonGroup * groupFractions = new QButtonGroup(); + groupFractions->setExclusive(true); + groupFractions->addButton(DefaultFractionsRadio); + groupFractions->addButton(DiagonalRadio); + groupFractions->addButton(StackedRadio); + + QButtonGroup * groupNumeralStyle = new QButtonGroup(); + groupNumeralStyle->setExclusive(true); + groupNumeralStyle->addButton(DefaultStyleRadio); + groupNumeralStyle->addButton(LiningRadio); + groupNumeralStyle->addButton(OldStyleRadio); + + QButtonGroup * groupNumeralWidth = new QButtonGroup(); + groupNumeralWidth->setExclusive(true); + groupNumeralWidth->addButton(DefaultWidthRadio); + groupNumeralWidth->addButton(ProportionalRadio); + groupNumeralWidth->addButton(TabularRadio); + + CommonCheck->setChecked(true); ContextualCheck->setChecked(true); DiscretionaryCheck->setChecked(false); @@ -663,31 +870,31 @@ HistoricalCheck->setChecked(false); NormalCapRadio->setChecked(true); - SmallRadio->setChecked(false); - SmallFromCRadio->setChecked(false); - AllSmallCapsRadio->setChecked(false); - PetiteRadio->setChecked(false); - PetiteCapRadio->setChecked(false); - AllPetiteCapsRadio->setChecked(false); - UnicaseRadio->setChecked(false); - TiltingRadio->setChecked(false); + // SmallRadio->setChecked(false); + // SmallFromCRadio->setChecked(false); + // AllSmallCapsRadio->setChecked(false); + // PetiteRadio->setChecked(false); + // PetiteCapRadio->setChecked(false); + // AllPetiteCapsRadio->setChecked(false); + // UnicaseRadio->setChecked(false); + // TitlingRadio->setChecked(false); DefaultStyleRadio->setChecked(true); - LiningRadio->setChecked(false); - OldStyleRadio->setChecked(false); + // LiningRadio->setChecked(false); + // OldStyleRadio->setChecked(false); DefaultWidthRadio->setChecked(true); - ProportionalRadio->setChecked(false); - TabularRadio->setChecked(false); + // ProportionalRadio->setChecked(false); + // TabularRadio->setChecked(false); DefaultFractionsRadio->setChecked(true); - DiagonalRadio->setChecked(false); - StackedRadio->setChecked(false); + // DiagonalRadio->setChecked(false); + // StackedRadio->setChecked(false); DefaultPosRadio->setChecked(true); - SubscriptRadio->setChecked(false); - SuperscriptRadio->setChecked(false); - OrdinalCheck->setChecked(false); + // SubscriptRadio->setChecked(false); + // SuperscriptRadio->setChecked(false); + // OrdinalCheck->setChecked(false); SlashedZeroCheck->setChecked(false); Index: scribus/ui/propertywidget_fontfeatures.h =================================================================== --- scribus/ui/propertywidget_fontfeatures.h (Revision 26320) +++ scribus/ui/propertywidget_fontfeatures.h (Arbeitskopie) @@ -7,8 +7,10 @@ #ifndef PROPERTYWIDGET_OPENTYPEFONTFEATURES_H #define PROPERTYWIDGET_OPENTYPEFONTFEATURES_H + #include "ui_propertywidget_fontfeaturesbase.h" #include "propertywidgetbase.h" +#include "fonts/scface.h" class CharStyle; class ParagraphStyle; @@ -34,9 +36,11 @@ void initWidgets(); void setCurrentItem(PageItem *item); void changeEvent(QEvent *e) override; + bool eventFilter(QObject *obj, QEvent *event) override; quint64 featureFlags() const; + // bool m_blockUpdate {false}; PageItem* m_item { nullptr }; ScribusMainWindow* m_ScMW { nullptr }; @@ -44,15 +48,34 @@ void setMainWindow(ScribusMainWindow *mw); void setDoc(ScribusDoc *d); void handleSelectionChanged(); + void iconSetChange(); void languageChange(); + void localeChange(); void unitChange() {} + void toggleLabelVisibility(bool v); + + // void showTextColors(const QString& strokeCol, double strokeShd); void showFontFeatures(const QString& s, const QStringList& availableFeatures); + // void showOutlineW(double x); + // void showShadowOffset(double x, double y); + // void showStrikeThru(double p, double w); + // void showTextEffects(int s); + // void showUnderline(double p, double w); + void updateCharStyle(const CharStyle& charStyle); void updateStyle(const ParagraphStyle& newCurrent); private slots: + // void handleOutlineWidth(); + // void handleShadowOffs(); + // void handleStrikeThru(); + // void handleTypeStyle(int s); + // void handleUnderline(); + // void handleTextOutline(); void handleFontFeatures(); + void handleFontPreview(QObject *obj); + signals: void needsRelayout(); }; Index: scribus/ui/propertywidget_hyphenation.cpp =================================================================== --- scribus/ui/propertywidget_hyphenation.cpp (Revision 26320) +++ scribus/ui/propertywidget_hyphenation.cpp (Arbeitskopie) @@ -10,8 +10,11 @@ #include "propertywidget_hyphenation.h" #include "appmodes.h" +#include "iconmanager.h" +#include "langmgr.h" #include "pageitem_table.h" #include "scribus.h" +#include "scribusapp.h" #include "scribusdoc.h" #include "selection.h" @@ -21,8 +24,18 @@ setupUi(this); hyphenCharLineEdit->setMaxLength(1); - layout()->setAlignment( Qt::AlignTop ); + hyphenCharLineEdit->setFixedWidth(30); + + labelSmallestWord->setLabelVisibility(false); + labelConsecutiveHyphens->setLabelVisibility(false); + labelCharacter->setLabelVisibility(false); + labelLanguage->setLabelVisibility(false); + + iconSetChange(); languageChange(); + + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void PropertyWidget_Hyphenation::setMainWindow(ScribusMainWindow *mw) @@ -43,6 +56,17 @@ void PropertyWidget_Hyphenation::languageChange() { retranslateUi(this); + + QSignalBlocker langComboBlocker(langCombo); + QStringList languageList; + LanguageManager::instance()->fillInstalledStringList(&languageList); + int oldLang = langCombo->currentIndex(); + langCombo->clear(); + langCombo->addItems(languageList); + langCombo->setCurrentIndex(oldLang); + + QSignalBlocker smallestWordBlocker(smallestWordSpinBox); + smallestWordSpinBox->setSuffix(tr(" characters")); } void PropertyWidget_Hyphenation::handleWordMin(int minWord) @@ -76,11 +100,27 @@ hyphenChar = 0; else hyphenChar = hyphenText.toUcs4()[0]; - qDebug() << hyphenChar; + tempSelection.addItem(m_item, true); m_doc->itemSelection_SetHyphenChar(hyphenChar, &tempSelection); } +void PropertyWidget_Hyphenation::handleHyphenate() +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + + m_doc->itemSelection_DoHyphenate(); +} + +void PropertyWidget_Hyphenation::handleDehyphenate() +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + + m_doc->itemSelection_DoDeHyphenate(); +} + void PropertyWidget_Hyphenation::setDoc(ScribusDoc *d) { if ((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning())) @@ -116,6 +156,23 @@ update(); } +void PropertyWidget_Hyphenation::toggleLabelVisibility(bool v) +{ + // labelSmallestWord->setLabelVisibility(v); + // labelConsecutiveHyphens->setLabelVisibility(v); + // labelCharacter->setLabelVisibility(v); + // labelLanguage->setLabelVisibility(v); +} + +void PropertyWidget_Hyphenation::iconSetChange() +{ + IconManager& im = IconManager::instance(); + labelLanguage->setPixmap(im.loadPixmap("paragraph-language")); + labelSmallestWord->setPixmap(im.loadPixmap("hyphen-smallest-word")); + labelConsecutiveHyphens->setPixmap(im.loadPixmap("hyphen-consecutive")); + labelCharacter->setPixmap(im.loadPixmap("hyphen-character")); +} + void PropertyWidget_Hyphenation::updateCharStyle(const CharStyle& charStyle) { if (!m_ScMW || m_ScMW->scriptIsRunning()) @@ -130,6 +187,8 @@ if (hyphenChar) hyphenText = QString::fromUcs4(&hyphenChar, 1); hyphenCharLineEdit->setText(hyphenText); + + showLanguage(charStyle.language()); } void PropertyWidget_Hyphenation::updateStyle(const ParagraphStyle& paraStyle) @@ -139,16 +198,45 @@ const CharStyle& charStyle = paraStyle.charStyle(); updateCharStyle(charStyle); + showLanguage(charStyle.language()); QSignalBlocker blocker(maxConsecutiveCountSpinBox); maxConsecutiveCountSpinBox->setValue(paraStyle.hyphenConsecutiveLines()); } +void PropertyWidget_Hyphenation::showLanguage(const QString &w) +{ + if (!m_ScMW || m_ScMW->scriptIsRunning()) + return; + QStringList lang; + LanguageManager::instance()->fillInstalledStringList(&lang); + QString langName = LanguageManager::instance()->getLangFromAbbrev(w, true); + + bool sigBlocked = langCombo->blockSignals(true); + langCombo->setCurrentIndex(lang.indexOf(langName)); + langCombo->blockSignals(sigBlocked); +} + +void PropertyWidget_Hyphenation::changeLang(int id) +{ + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + QStringList languageList; + LanguageManager::instance()->fillInstalledStringList(&languageList); + QString abrv = LanguageManager::instance()->getAbbrevFromLang(languageList.value(id),false); + Selection tempSelection(this, false); + tempSelection.addItem(m_item, true); + m_doc->itemSelection_SetLanguage(abrv, &tempSelection); +} + void PropertyWidget_Hyphenation::connectSignals() { connect(smallestWordSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleWordMin(int))); connect(maxConsecutiveCountSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleConsecutiveLines(int))); connect(hyphenCharLineEdit, SIGNAL(textChanged(QString)), this, SLOT(handleHyphenChar(QString))); + connect(langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeLang(int))); + connect(hyphenateButton, SIGNAL(clicked()), this, SLOT(handleHyphenate())); + connect(dehyphenateButton, SIGNAL(clicked()), this, SLOT(handleDehyphenate())); } void PropertyWidget_Hyphenation::disconnectSignals() @@ -156,6 +244,9 @@ disconnect(smallestWordSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleWordMin(int))); disconnect(maxConsecutiveCountSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleConsecutiveLines(int))); disconnect(hyphenCharLineEdit, SIGNAL(textChanged(QString)), this, SLOT(handleHyphenChar(QString))); + disconnect(langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeLang(int))); + disconnect(hyphenateButton, SIGNAL(clicked()), this, SLOT(handleHyphenate())); + disconnect(dehyphenateButton, SIGNAL(clicked()), this, SLOT(handleDehyphenate())); } void PropertyWidget_Hyphenation::configureWidgets() @@ -163,8 +254,14 @@ bool enabled = false; if (m_item && m_doc) { - if (m_item->isPathText() || m_item->isTextFrame() || m_item->isTable()) - enabled = true; + if (m_item->isTextFrame() || m_item->isPathText() || m_item->isTable()) + { + PageItem_TextFrame *textItem = m_item->asTextFrame(); + if (m_doc->appMode == modeEditTable) + textItem = m_item->asTable()->activeCell().textFrame(); + if (textItem) + enabled = true; + } if ((m_item->isGroup()) && (!m_item->isSingleSel)) enabled = false; if (m_item->isOSGFrame() || m_item->isSymbol()) @@ -188,17 +285,18 @@ disconnectSignals(); configureWidgets(); - if (m_item) + if (!m_item) + return; + + if (m_item->isTextFrame() || m_item->isPathText() || m_item->isTable()) { - if (m_item->isTextFrame() || m_item->isPathText() || m_item->isTable()) - { - ParagraphStyle parStyle = m_item->itemText.defaultStyle(); - if (m_doc->appMode == modeEdit) - m_item->currentTextProps(parStyle); - else if (m_doc->appMode == modeEditTable) - m_item->asTable()->activeCell().textFrame()->currentTextProps(parStyle); - updateStyle(parStyle); - } - connectSignals(); + ParagraphStyle parStyle = m_item->itemText.defaultStyle(); + if (m_doc->appMode == modeEdit) + m_item->currentTextProps(parStyle); + else if (m_doc->appMode == modeEditTable) + m_item->asTable()->activeCell().textFrame()->currentTextProps(parStyle); + updateStyle(parStyle); } + connectSignals(); + } Index: scribus/ui/propertywidget_hyphenation.h =================================================================== --- scribus/ui/propertywidget_hyphenation.h (Revision 26320) +++ scribus/ui/propertywidget_hyphenation.h (Arbeitskopie) @@ -39,15 +39,21 @@ void setMainWindow(ScribusMainWindow *mw); void setDoc(ScribusDoc *d); void handleSelectionChanged(); + void toggleLabelVisibility(bool v); + void iconSetChange(); void languageChange(); void unitChange() {}; void updateCharStyle(const CharStyle& charStyle); void updateStyle(const ParagraphStyle& paraStyle); + void showLanguage(const QString& w); + void changeLang(int id); private slots: void handleWordMin(int minWord); void handleConsecutiveLines(int consecutiveLines); void handleHyphenChar(const QString& hyphenText); + void handleHyphenate(); + void handleDehyphenate(); }; #endif // PROPERTYWIDGET_HYPHENATION_H Index: scribus/ui/propertywidget_optmargins.cpp =================================================================== --- scribus/ui/propertywidget_optmargins.cpp (Revision 26320) +++ scribus/ui/propertywidget_optmargins.cpp (nicht existent) @@ -1,214 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ - -#include "propertywidget_optmargins.h" - -#include "appmodehelper.h" -#include "appmodes.h" -#include "pageitem_table.h" -#include "scribus.h" -#include "scribusdoc.h" -#include "selection.h" - - -PropertyWidget_OptMargins::PropertyWidget_OptMargins(QWidget* parent) : QFrame(parent) -{ - setupUi(this); - - layout()->setAlignment(Qt::AlignTop); - - languageChange(); -} - -void PropertyWidget_OptMargins::setMainWindow(ScribusMainWindow* mw) -{ - m_ScMW = mw; - - connect(m_ScMW->appModeHelper, SIGNAL(AppModeChanged(int,int)), this, SLOT(handleAppModeChanged(int,int))); - connect(m_ScMW, SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int))); -} - -void PropertyWidget_OptMargins::setDoc(ScribusDoc *d) -{ - if ((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning())) - return; - - if (m_doc) - { - disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); - disconnect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); - } - - m_doc = d; - m_item = nullptr; - - if (m_doc.isNull()) - { - disconnectSignals(); - return; - } - - connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); - connect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); -} - -void PropertyWidget_OptMargins::setCurrentItem(PageItem *item) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - //CB We shouldn't really need to process this if our item is the same one - //maybe we do if the item has been changed by scripter.. but that should probably - //set some status if so. - //FIXME: This won't work until when a canvas deselect happens, m_item must be nullptr. - //if (m_item == i) - // return; - - if (item && m_doc.isNull()) - setDoc(item->doc()); - - m_item = item; - - disconnectSignals(); - configureWidgets(); - - if (m_item) - { - if (m_item->isTextFrame() || m_item->isPathText()) - { - ParagraphStyle parStyle = m_item->itemText.defaultStyle(); - if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable) - m_item->currentTextProps(parStyle); - showOpticalMargins(parStyle); - } - - connectSignals(); - } -} - -void PropertyWidget_OptMargins::connectSignals() -{ - connect(optMarginRadioNone , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - connect(optMarginRadioBoth , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - connect(optMarginRadioLeft , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - connect(optMarginRadioRight , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - connect(optMarginResetButton, SIGNAL(clicked()), this, SLOT(resetOpticalMargins()) ); -} - -void PropertyWidget_OptMargins::disconnectSignals() -{ - disconnect(optMarginRadioNone , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - disconnect(optMarginRadioBoth , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - disconnect(optMarginRadioLeft , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - disconnect(optMarginRadioRight , SIGNAL(clicked()), this, SLOT(handleOpticalMargins()) ); - disconnect(optMarginResetButton, SIGNAL(clicked()), this, SLOT(resetOpticalMargins()) ); -} - -void PropertyWidget_OptMargins::configureWidgets() -{ - bool enabled = false; - if (m_item && m_doc) - { - PageItem_TextFrame* textItem = m_item->asTextFrame(); - if (m_doc->appMode == modeEditTable) - textItem = m_item->asTable()->activeCell().textFrame(); - - enabled = (m_item->isPathText() || (textItem != nullptr)); - enabled &= (m_doc->m_Selection->count() == 1); - } - setEnabled(enabled); -} - -void PropertyWidget_OptMargins::handleAppModeChanged(int oldMode, int mode) -{ - if (oldMode == modeEditTable || mode == modeEditTable) - { - setCurrentItem(m_item); - } -} - -void PropertyWidget_OptMargins::handleSelectionChanged() -{ - if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - - PageItem* currItem = currentItemFromSelection(); - setCurrentItem(currItem); - updateGeometry(); -} - -void PropertyWidget_OptMargins::showOpticalMargins(const ParagraphStyle & pStyle) -{ - ParagraphStyle::OpticalMarginType omt(static_cast<ParagraphStyle::OpticalMarginType>(pStyle.opticalMargins())); - bool blocked = optMarginRadioBoth->blockSignals(true); - if (omt == ParagraphStyle::OM_Default) - optMarginRadioBoth->setChecked(true); - else if (omt == ParagraphStyle::OM_LeftHangingPunct) - optMarginRadioLeft->setChecked(true); - else if (omt == ParagraphStyle::OM_RightHangingPunct) - optMarginRadioRight->setChecked(true); - else - optMarginRadioNone->setChecked(true); - optMarginRadioBoth->blockSignals(blocked); -} - -void PropertyWidget_OptMargins::updateStyle(const ParagraphStyle& newCurrent) -{ - showOpticalMargins(newCurrent); -} - -void PropertyWidget_OptMargins::handleOpticalMargins() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - int omt(ParagraphStyle::OM_None); - if (optMarginRadioBoth->isChecked()) - omt = ParagraphStyle::OM_Default; - else if (optMarginRadioLeft->isChecked()) - omt = ParagraphStyle::OM_LeftHangingPunct; - else if (optMarginRadioRight->isChecked()) - omt = ParagraphStyle::OM_RightHangingPunct; - - PageItem *item = m_item; - if (m_doc->appMode == modeEditTable) - item = m_item->asTable()->activeCell().textFrame(); - if (item != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(item, true); - m_doc->itemSelection_SetOpticalMargins(omt, &tempSelection); - } -} - -void PropertyWidget_OptMargins::resetOpticalMargins() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *item = m_item; - if (m_doc->appMode == modeEditTable) - item = m_item->asTable()->activeCell().textFrame(); - if (item != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(item, true); - m_doc->itemSelection_resetOpticalMargins(&tempSelection); - } -} - -void PropertyWidget_OptMargins::changeEvent(QEvent *e) -{ - if (e->type() == QEvent::LanguageChange) - { - languageChange(); - return; - } - QWidget::changeEvent(e); -} - -void PropertyWidget_OptMargins::languageChange() -{ - retranslateUi(this); -} Index: scribus/ui/propertywidget_optmargins.h =================================================================== --- scribus/ui/propertywidget_optmargins.h (Revision 26320) +++ scribus/ui/propertywidget_optmargins.h (nicht existent) @@ -1,59 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ -#ifndef PROPERTYWIDGET_OPTMARGINS_H -#define PROPERTYWIDGET_OPTMARGINS_H - -#include "ui_propertywidget_optmarginsbase.h" - -#include "propertywidgetbase.h" - -class ParagraphStyle; -class ScribusDoc; -class ScribusMainWindow; - -class PropertyWidget_OptMargins : public QFrame, public Ui::PropertyWidget_OptMarginsBase, - public PropertyWidgetBase -{ - Q_OBJECT - -public: - PropertyWidget_OptMargins(QWidget* parent); - ~PropertyWidget_OptMargins() {}; - - void updateStyle(const ParagraphStyle& newCurrent); - -protected: - PageItem * m_item { nullptr }; - ScribusMainWindow* m_ScMW { nullptr }; - - void connectSignals(); - void disconnectSignals(); - - void configureWidgets(); - void setCurrentItem(PageItem *item); - - void changeEvent(QEvent *e) override; - -public slots: - void setMainWindow(ScribusMainWindow *mw); - void setDoc(ScribusDoc *d); - - void handleAppModeChanged(int oldMode, int mode); - void handleSelectionChanged(); - void handleUpdateRequest(int) {}; - - void languageChange(); - void unitChange() {}; - - void showOpticalMargins(const ParagraphStyle& pStyle); - -private slots: - void handleOpticalMargins(); - void resetOpticalMargins(); -}; - -#endif Index: scribus/ui/propertywidget_optmarginsbase.ui =================================================================== --- scribus/ui/propertywidget_optmarginsbase.ui (Revision 26320) +++ scribus/ui/propertywidget_optmarginsbase.ui (nicht existent) @@ -1,68 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>PropertyWidget_OptMarginsBase</class> - <widget class="QFrame" name="PropertyWidget_OptMarginsBase"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>210</width> - <height>137</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>3</number> - </property> - <property name="topMargin"> - <number>3</number> - </property> - <property name="rightMargin"> - <number>3</number> - </property> - <property name="bottomMargin"> - <number>3</number> - </property> - <item> - <widget class="QRadioButton" name="optMarginRadioNone"> - <property name="text"> - <string>None</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="optMarginRadioBoth"> - <property name="text"> - <string>Both Sides</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="optMarginRadioLeft"> - <property name="text"> - <string>Left Only</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="optMarginRadioRight"> - <property name="text"> - <string>Right Only</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="optMarginResetButton"> - <property name="text"> - <string>Reset</string> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> Index: scribus/ui/propertywidget_orphans.cpp =================================================================== --- scribus/ui/propertywidget_orphans.cpp (Revision 26320) +++ scribus/ui/propertywidget_orphans.cpp (Arbeitskopie) @@ -7,7 +7,8 @@ #include "propertywidget_orphans.h" - +#include "iconmanager.h" +#include "scribusapp.h" #include "scribusdoc.h" PropertyWidget_Orphans::PropertyWidget_Orphans(QWidget* parent) : QFrame(parent) @@ -18,7 +19,10 @@ keepLinesStart->setDecimals(0); keepLinesEnd->setDecimals(0); + iconSetChange(); languageChange(); + + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); } void PropertyWidget_Orphans::connectSignals() @@ -25,8 +29,8 @@ { connect(keepLinesStart, SIGNAL(valueChanged(double)), this, SLOT(handleKeepLinesStart())); connect(keepLinesEnd, SIGNAL(valueChanged(double)), this, SLOT(handleKeepLinesEnd())); - connect(keepTogether, SIGNAL(stateChanged(int)), this, SLOT(handleKeepTogether())); - connect(keepWithNext, SIGNAL(stateChanged(int)), this, SLOT(handleKeepWithNext())); + connect(keepTogether, SIGNAL(toggled(bool)), this, SLOT(handleKeepTogether())); + connect(keepWithNext, SIGNAL(toggled(bool)), this, SLOT(handleKeepWithNext())); } void PropertyWidget_Orphans::disconnectSignals() @@ -33,8 +37,8 @@ { disconnect(keepLinesStart, SIGNAL(valueChanged(double)), this, SLOT(handleKeepLinesStart())); disconnect(keepLinesEnd, SIGNAL(valueChanged(double)), this, SLOT(handleKeepLinesEnd())); - disconnect(keepTogether, SIGNAL(stateChanged(int)), this, SLOT(handleKeepTogether())); - disconnect(keepWithNext, SIGNAL(stateChanged(int)), this, SLOT(handleKeepWithNext())); + disconnect(keepTogether, SIGNAL(toggled(bool)), this, SLOT(handleKeepTogether())); + disconnect(keepWithNext, SIGNAL(toggled(bool)), this, SLOT(handleKeepWithNext())); } void PropertyWidget_Orphans::handleKeepLinesStart() @@ -89,6 +93,14 @@ QWidget::changeEvent(e); } +void PropertyWidget_Orphans::iconSetChange() +{ + IconManager &im = IconManager::instance(); + + keepLabelStart->setPixmap(im.loadPixmap("paragraph-orphan")); + keepLabelEnd->setPixmap(im.loadPixmap("paragraph-widow")); +} + void PropertyWidget_Orphans::languageChange() { retranslateUi(this); Index: scribus/ui/propertywidget_orphans.h =================================================================== --- scribus/ui/propertywidget_orphans.h (Revision 26320) +++ scribus/ui/propertywidget_orphans.h (Arbeitskopie) @@ -27,6 +27,7 @@ void changeEvent(QEvent *e) override; public slots: + void iconSetChange(); void languageChange(); void handleKeepLinesStart(); void handleKeepLinesEnd(); Index: scribus/ui/propertywidget_pareffect.cpp =================================================================== --- scribus/ui/propertywidget_pareffect.cpp (Revision 26320) +++ scribus/ui/propertywidget_pareffect.cpp (Arbeitskopie) @@ -25,8 +25,6 @@ { setupUi(this); - layout()->setAlignment(Qt::AlignTop); - languageChange(); dropCapLines->setValue(2); @@ -33,16 +31,24 @@ if (m_doc) peCharStyleCombo->updateStyleList(); fillBulletStrEditCombo(); - enableParEffect(false); - bulletCharTableButton->setIcon(IconManager::instance().loadIcon("22/insert-table.png")); + numStart->setMinimum(1); numStart->setMaximum(9999); numLevelSpin->setMinimum(1); numLevelSpin->setMaximum(3); + numPrefix->setMaxLength(5); + numPrefix->setMaximumWidth(QFontMetrics(numPrefix->font()).averageCharWidth() * 7); + numSuffix->setMaxLength(5); + numSuffix->setMaximumWidth(QFontMetrics(numSuffix->font()).averageCharWidth() * 7); dropCapLines->setMinimum(2); dropCapLines->setMaximum(99); + peCombo->setCurrentIndex(0); + setType(peCombo->currentData().toInt()); + iconSetChange(); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); } void PropertyWidget_ParEffect::setMainWindow(ScribusMainWindow* mw) @@ -110,6 +116,9 @@ { IconManager& iconManager = IconManager::instance(); bulletCharTableButton->setIcon(iconManager.loadIcon("22/insert-table.png")); + peCharStyleLabel->setPixmap(iconManager.loadPixmap("character-style")); + peOffsetLabel->setPixmap(iconManager.loadPixmap("paragraph-list-offset")); + peLabel->setPixmap(iconManager.loadPixmap("paragraph-effects-style")); } void PropertyWidget_ParEffect::unitChange() @@ -150,7 +159,7 @@ numComboBox->insertItems(0, numNames); } -void PropertyWidget_ParEffect::updateCharStyles() +void PropertyWidget_ParEffect::updateTextStyles() { peCharStyleCombo->updateStyleList(); } @@ -162,59 +171,21 @@ peCharStyleCombo->blockSignals(blocked); } -void PropertyWidget_ParEffect::enableDropCap(bool enable) +void PropertyWidget_ParEffect::setType(int id) { -// dropCapRadio_->setChecked(enable); - dropCapLines->setEnabled(enable); - if (enable) + if (id == -1) // No effect { - dropCapsGroup->show(); - enableBullet(false); - enableNum(false); + stackedWidget->setVisible(false); + peGroup->setVisible(false); + peCombo->setCurrentIndex(0); } else - dropCapsGroup->hide(); -} -void PropertyWidget_ParEffect::enableBullet(bool enable) -{ - bulletStrEdit->setVisible(enable); - bulletCharTableButton->setVisible(enable); - bullGroup->setVisible(enable); - if (enable) { - enableDropCap(false); - enableNum(false); + stackedWidget->setCurrentIndex(id); + stackedWidget->setVisible(true); + peGroup->setVisible(true); } } -void PropertyWidget_ParEffect::enableNum(bool enable) -{ - numComboBox->setVisible(enable); - numLevelSpin->setVisible(enable); - numStart->setVisible(enable); - numPrefix->setVisible(enable); - numSuffix->setVisible(enable); - numFormatCombo->setVisible(enable); - numGroup->setVisible(enable); - if (enable) - { - enableBullet(false); - enableDropCap(false); - } -} -void PropertyWidget_ParEffect::enableParEffect(bool enable) -{ - peOffset->setVisible(enable); - peCharStyleCombo->setVisible(enable); - peIndent->setVisible(enable); - peGroup->setVisible(enable); - if (!enable) - { - enableBullet(false); - enableDropCap(false); - enableNum(false); - peCombo->setCurrentIndex(0); - } -} void PropertyWidget_ParEffect::fillBulletStrEditCombo() { @@ -232,10 +203,10 @@ QSignalBlocker sb(peCombo); int currIndex = peCombo->currentIndex(); peCombo->clear(); - peCombo->addItem(tr("No Paragraph Effects")); - peCombo->addItem(tr("Drop Caps")); - peCombo->addItem(tr("Bulleted List")); - peCombo->addItem(tr("Numbered List")); + peCombo->addItem(tr("No Paragraph Effects"), -1); + peCombo->addItem(tr("Drop Caps"), 0); + peCombo->addItem(tr("Bulleted List"), 1); + peCombo->addItem(tr("Numbered List"), 2); peCombo->setCurrentIndex(currIndex); } @@ -245,7 +216,7 @@ if (peCombo->currentIndex() && !newPStyle.hasBullet() && !newPStyle.hasDropCap() && !newPStyle.hasNum()) { - enableParEffect(false); + setType(-1); return; } @@ -262,25 +233,23 @@ QSignalBlocker blockerB(peIndent); QSignalBlocker blockerC(peCharStyleCombo); - bool enablePE = true; if (newPStyle.hasDropCap()) { peCombo->setCurrentIndex(1); - enableDropCap(true); } else if (newPStyle.hasBullet()) { peCombo->setCurrentIndex(2); - enableBullet(true); } else if (newPStyle.hasNum()) { peCombo->setCurrentIndex(3); - enableNum(true); } else - enablePE = false; + peCombo->setCurrentIndex(0); + setType(peCombo->currentData().toInt()); + QString numName = numComboBox->currentText(); dropCapLines->setValue(newPStyle.dropCapLines()); bulletStrEdit->setEditText(newPStyle.bulletStr()); @@ -303,8 +272,6 @@ peIndent->setChecked(newPStyle.parEffectIndent()); showCharStyle(newPStyle.peCharStyleName()); - enableParEffect(enablePE); - if (oldPeComboIndex != peCombo->currentIndex()) emit needsRelayout(); } @@ -349,7 +316,7 @@ PageItem_TextFrame *textItem = m_item->asTextFrame(); if (m_doc->appMode == modeEditTable) textItem = m_item->asTable()->activeCell().textFrame(); - if (textItem || m_item->isPathText()) + if (textItem)// || m_item->isPathText()) enabled = true; } setEnabled(enabled); @@ -376,7 +343,7 @@ void PropertyWidget_ParEffect::handleUpdateRequest(int updateFlags) { if (updateFlags & reqCharStylesUpdate) - updateCharStyles(); + updateTextStyles(); if (updateFlags & reqStyleComboDocUpdate) setDoc(m_doc ? m_doc : nullptr); if (updateFlags & reqNumUpdate) @@ -389,10 +356,9 @@ return; ParagraphStyle newStyle; - enableParEffect(peCombo->currentIndex() != 0); + if (peCombo->currentIndex() == 1) { - enableDropCap(true); newStyle.setDropCapLines(dropCapLines->value()); newStyle.setHasDropCap(true); newStyle.setHasBullet(false); @@ -400,7 +366,6 @@ } else if (peCombo->currentIndex() == 2) { - enableBullet(true); newStyle.setHasBullet(true); QString bStr = bulletStrEdit->currentText(); if (bStr.isEmpty()) @@ -411,7 +376,6 @@ } else if (peCombo->currentIndex() == 3) { - enableNum(true); newStyle.setHasDropCap(false); newStyle.setHasBullet(false); newStyle.setHasNum(true); @@ -435,6 +399,9 @@ } newStyle.setParEffectOffset(peOffset->value() / m_unitRatio); newStyle.setParEffectIndent(peIndent->isChecked()); + + setType(peCombo->currentData().toInt()); + handleChanges(m_item, newStyle); emit needsRelayout(); Index: scribus/ui/propertywidget_pareffect.h =================================================================== --- scribus/ui/propertywidget_pareffect.h (Revision 26320) +++ scribus/ui/propertywidget_pareffect.h (Arbeitskopie) @@ -3,7 +3,7 @@ #include <QVector> -#include "numeration.h" +//#include "numeration.h" #include "propertywidgetbase.h" #include "ui/charselectenhanced.h" #include "ui_propertywidget_pareffectbase.h" @@ -22,7 +22,7 @@ ~PropertyWidget_ParEffect() {} void updateStyle(const ParagraphStyle& newPStyle); - void updateCharStyles(); + void updateTextStyles(); void showCharStyle(const QString& name); void connectSignals(); @@ -76,12 +76,8 @@ private: void openEnhanced(); void closeEnhanced(bool show = false); - void enableDropCap(bool); - void enableBullet(bool); - void enableNum(bool); - void enableParEffect(bool); + void setType(int id); void fillBulletStrEditCombo(); - void fillPECombo(); signals: Index: scribus/ui/propertywidget_pathtext.cpp =================================================================== --- scribus/ui/propertywidget_pathtext.cpp (Revision 26320) +++ scribus/ui/propertywidget_pathtext.cpp (Arbeitskopie) @@ -9,6 +9,7 @@ #include <QSignalBlocker> +#include "iconmanager.h" #include "localemgr.h" #include "scribus.h" #include "scribusapp.h" @@ -27,9 +28,12 @@ distFromCurve->setValues(-300, 300, 2, 0); distFromCurve->setSingleStep(10); + languageChange(); + iconSetChange(); + connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); - - languageChange(); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); } void PropertyWidget_PathText::setMainWindow(ScribusMainWindow* mw) @@ -118,7 +122,7 @@ { connect(showCurveCheckBox, SIGNAL(clicked()) , this, SLOT(handlePathLine())); connect(pathTextType , SIGNAL(activated(int)), this, SLOT(handlePathType())); - connect(flippedPathText , SIGNAL(clicked()) , this, SLOT(handlePathFlip())); + connect(flippedPathText , SIGNAL(toggled(bool)) , this, SLOT(handlePathFlip())); connect(startOffset , SIGNAL(valueChanged(double)), this, SLOT(handlePathDist())); connect(distFromCurve , SIGNAL(valueChanged(double)), this, SLOT(handlePathOffs())); } @@ -127,7 +131,7 @@ { disconnect(showCurveCheckBox, SIGNAL(clicked()) , this, SLOT(handlePathLine())); disconnect(pathTextType , SIGNAL(activated(int)), this, SLOT(handlePathType())); - disconnect(flippedPathText , SIGNAL(clicked()) , this, SLOT(handlePathFlip())); + disconnect(flippedPathText , SIGNAL(toggled(bool)) , this, SLOT(handlePathFlip())); disconnect(startOffset , SIGNAL(valueChanged(double)), this, SLOT(handlePathDist())); disconnect(distFromCurve , SIGNAL(valueChanged(double)), this, SLOT(handlePathOffs())); } @@ -217,6 +221,16 @@ QWidget::changeEvent(e); } + +void PropertyWidget_PathText::iconSetChange() +{ + IconManager &im = IconManager::instance(); + + startOffsetLabel->setPixmap(im.loadPixmap("text-on-path-offset")); + distFromCurveLabel->setPixmap(im.loadPixmap("text-on-path-distance")); + flippedPathText->setIcon(im.loadIcon("text-on-path-flip")); +} + void PropertyWidget_PathText::languageChange() { QSignalBlocker pathTextTypeBlocker(pathTextType); @@ -227,11 +241,10 @@ pathTextType->addItem( tr("Skew")); pathTextType->setCurrentIndex(oldPathType); - flippedPathText->setText( tr("Flip Text")); showCurveCheckBox->setText( tr("Show Curve")); - pathTextTypeLabel->setText( tr("Type:")); - startOffsetLabel->setText( tr("Start Offset:")); - distFromCurveLabel->setText( tr("Distance from Curve:")); + pathTextTypeLabel->setText( tr("Type")); + startOffsetLabel->setText( tr("Start Offset")); + distFromCurveLabel->setText( tr("Distance")); QString ptSuffix = tr(" pt"); QString unitSuffix = m_doc ? unitGetSuffixFromIndex(m_doc->unitIndex()) : ptSuffix; @@ -260,3 +273,12 @@ startOffset->setLocale(l); distFromCurve->setLocale(l); } + +void PropertyWidget_PathText::toggleLabelVisibility(bool v) +{ + distFromCurveLabel->setLabelVisibility(v); + startOffsetLabel->setLabelVisibility(v); + pathTextTypeLabel->setLabelVisibility(v); + curveLabel->setLabelVisibility(v); + flipLabel->setLabelVisibility(v); +} Index: scribus/ui/propertywidget_pathtext.h =================================================================== --- scribus/ui/propertywidget_pathtext.h (Revision 26320) +++ scribus/ui/propertywidget_pathtext.h (Arbeitskopie) @@ -45,9 +45,11 @@ void handleSelectionChanged(); void handleUpdateRequest(int); + void iconSetChange(); void languageChange(); void unitChange(); void localeChange(); + void toggleLabelVisibility(bool v); private slots: void handlePathType(); Index: scribus/ui/propertywidget_text.cpp =================================================================== --- scribus/ui/propertywidget_text.cpp (Revision 26320) +++ scribus/ui/propertywidget_text.cpp (Arbeitskopie) @@ -5,7 +5,6 @@ for which a new license (GPL+exception) is in place. */ #include "propertywidget_text.h" -#include "ui_propertywidget_textbase.h" #include "appmodes.h" #include "commonstrings.h" @@ -20,9 +19,7 @@ #include "selection.h" #include "stylecombos.h" #include "undomanager.h" -#include "langmgr.h" - PropertyWidget_Text::PropertyWidget_Text( QWidget* parent) : QFrame(parent) { setupUi(this); @@ -29,23 +26,36 @@ fontSize->setPrefix(""); + buttonTextColor->setContext(Context::Text); + buttonTextColor->setMenuContextType(ColorButton::Floating); + buttonTextColor->setColor( CommonStrings::tr_NoneColor); + buttonTextColor->setIconSize(QSize(20, 20)); + buttonTextColor->setApplyColorOnIcon(true); + + buttonBackgroundColor->setContext(Context::TextBackground); + buttonBackgroundColor->setMenuContextType(ColorButton::Floating); + buttonBackgroundColor->setColor(CommonStrings::tr_NoneColor); +// buttonBackgroundColor->setIconSize(QSize(16, 16)); + + buttonStrokeColor->setContext(Context::TextOutline); + buttonStrokeColor->setMenuContextType(ColorButton::Floating); + buttonStrokeColor->setColor(CommonStrings::tr_NoneColor); + buttonStrokeColor->setIconSize(QSize(20, 20)); + + labelFontSize->setLabelVisibility(false); + labelLineSpacing->setLabelVisibility(false); + labelLineHeight->setLabelVisibility(false); + + fonts->toggleLabelVisibility(false); + fonts->setGuestWidget(labelFontSize); + iconSetChange(); languageChange(); - connect(lineSpacing , SIGNAL(valueChanged(double)), this, SLOT(handleLineSpacing())); - connect(fonts , SIGNAL(fontSelected(QString)), this, SLOT(handleTextFont(QString))); - connect(fontSize , SIGNAL(valueChanged(double)), this, SLOT(handleFontSize())); - connect(textAlignment , SIGNAL(State(int)) , this, SLOT(handleAlignment(int))); - connect(textDirection , SIGNAL(State(int)) , this, SLOT(handleDirection(int))); - connect(charStyleClear, SIGNAL(clicked()), this, SLOT(doClearCStyle())); - connect(paraStyleClear, SIGNAL(clicked()), this, SLOT(doClearPStyle())); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); + connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); + connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool))); - connect(lineSpacingModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(handleLineSpacingMode(int))); - connect(langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeLang(int))); - -// connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); -// connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); - setEnabled(false); } @@ -53,10 +63,7 @@ { m_ScMW = mw; -// connect(m_ScMW, SIGNAL(UpdateRequest(int)) , this , SLOT(handleUpdateRequest(int))); - - connect(paraStyleCombo, SIGNAL(newStyle(QString)), m_ScMW, SLOT(setNewParStyle(QString)), Qt::UniqueConnection); - connect(charStyleCombo, SIGNAL(newStyle(QString)), m_ScMW, SLOT(setNewCharStyle(QString)), Qt::UniqueConnection); + connect(m_ScMW, SIGNAL(UpdateRequest(int)) , this , SLOT(handleUpdateRequest(int))); } void PropertyWidget_Text::setDoc(ScribusDoc *d) @@ -79,11 +86,13 @@ lineSpacing->setValues(1, 2048, 2, 1); fonts->rebuildList(m_doc); - paraStyleCombo->setDoc(m_doc); - charStyleCombo->setDoc(m_doc); + buttonTextColor->setDoc(m_doc); + buttonBackgroundColor->setDoc(m_doc); + buttonStrokeColor->setDoc(m_doc); if (m_doc.isNull()) { + disconnectSignals(); return; } @@ -101,6 +110,7 @@ currentItem = m_doc->m_Selection->itemAt(0); else if (m_doc->m_Selection->count() == 1) currentItem = m_doc->m_Selection->itemAt(0); + if (currentItem && currentItem->isTable() && m_doc->appMode == modeEditTable) currentItem = currentItem->asTable()->activeCell().textFrame(); } @@ -108,6 +118,28 @@ return currentItem; } +void PropertyWidget_Text::connectSignals() +{ + connect(lineSpacing , SIGNAL(valueChanged(double)), this, SLOT(handleLineSpacing())); + connect(fonts , SIGNAL(fontSelected(QString)), this, SLOT(handleTextFont(QString))); + connect(fontSize , SIGNAL(valueChanged(double)), this, SLOT(handleFontSize())); + connect(lineSpacingModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(handleLineSpacingMode(int))); + connect(buttonTextColor , SIGNAL(changed()), this, SLOT(handleTextFill())); + connect(buttonBackgroundColor , SIGNAL(changed()), this, SLOT(handleTextBackground())); + connect(buttonStrokeColor, SIGNAL(changed()), this, SLOT(handleTextStroke())); +} + +void PropertyWidget_Text::disconnectSignals() +{ + disconnect(lineSpacing , SIGNAL(valueChanged(double)), this, SLOT(handleLineSpacing())); + disconnect(fonts , SIGNAL(fontSelected(QString)), this, SLOT(handleTextFont(QString))); + disconnect(fontSize , SIGNAL(valueChanged(double)), this, SLOT(handleFontSize())); + disconnect(lineSpacingModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(handleLineSpacingMode(int))); + disconnect(buttonTextColor , SIGNAL(changed()), this, SLOT(handleTextFill())); + disconnect(buttonBackgroundColor , SIGNAL(changed()), this, SLOT(handleTextBackground())); + disconnect(buttonStrokeColor, SIGNAL(changed()), this, SLOT(handleTextStroke())); +} + void PropertyWidget_Text::handleSelectionChanged() { if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning()) @@ -151,24 +183,11 @@ void PropertyWidget_Text::handleUpdateRequest(int updateFlags) { - // ColorWidget will handle its update itself - /*if (updateFlags & reqColorsUpdate) - updateColorList();*/ - if (updateFlags & reqCharStylesUpdate) - { - charStyleCombo->updateStyleList(); - } - if (updateFlags & reqParaStylesUpdate) - paraStyleCombo->updateStyleList(); if (updateFlags & reqDefFontListUpdate) fonts->rebuildList(nullptr); + if (updateFlags & reqDocFontListUpdate) fonts->rebuildList(m_haveDoc ? m_doc : nullptr); - if (updateFlags & reqStyleComboDocUpdate) - { - paraStyleCombo->setDoc(m_haveDoc ? m_doc : nullptr); - charStyleCombo->setDoc(m_haveDoc ? m_doc : nullptr); - } } void PropertyWidget_Text::setCurrentItem(PageItem *item) @@ -182,11 +201,14 @@ //if (m_item == i) // return; + disconnectSignals(); + if (!m_doc) setDoc(item->doc()); m_haveItem = false; m_item = item; + m_haveItem = true; if ((m_item->isGroup()) && (!m_item->isSingleSel)) { @@ -193,15 +215,15 @@ setEnabled(false); } - m_haveItem = true; - - if (m_item->isTextFrame() || m_item->isPathText() || m_item->isTable()) { ParagraphStyle parStyle = m_item->itemText.defaultStyle(); if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable) m_item->currentTextProps(parStyle); + updateStyle(parStyle); + setEnabled(true); + } if (m_item->isOSGFrame()) { @@ -211,21 +233,26 @@ { setEnabled(false); } + + connectSignals(); } void PropertyWidget_Text::iconSetChange() { - IconManager& iconManager = IconManager::instance(); + IconManager& im = IconManager::instance(); - fontSizeLabel->setPixmap(iconManager.loadPixmap("zeichen.png")); - lineSpacingLabel->setPixmap(iconManager.loadPixmap("linespacing2.png")); - textAlignmentLabel->setPixmap(iconManager.loadPixmap("22/text-align.png")); - langLabel->setPixmap(iconManager.loadPixmap("22/language.png")); - paraStyleLabel->setPixmap(iconManager.loadPixmap("22/paragraph-style.png")); - charStyleLabel->setPixmap(iconManager.loadPixmap("22/character-style.png")); + labelFontSize->setPixmap(im.loadPixmap("font-size")); + labelLineSpacing->setPixmap(im.loadPixmap("paragraph-line-height")); + buttonTextColor->setIcon(im.loadIcon("text-color", buttonTextColor->iconSize())); + buttonStrokeColor->setIcon(im.loadIcon("text-outline-color", buttonStrokeColor->iconSize())); +} - paraStyleClear->setIcon(iconManager.loadPixmap("16/edit-clear.png")); - charStyleClear->setIcon(iconManager.loadPixmap("16/edit-clear.png")); + +void PropertyWidget_Text::toggleLabelVisibility(bool v) +{ + labelTextColor->setLabelVisibility(v); + labelBackgroundColor->setLabelVisibility(v); + labelStrokeColor->setLabelVisibility(v); } @@ -245,33 +272,30 @@ m_doc->itemSelection_SetLineSpacingMode(id, &tempSelection); updateStyle(((m_doc->appMode == modeEdit) || (m_doc->appMode == modeEditTable)) ? m_item->currentStyle() : m_item->itemText.defaultStyle()); m_doc->regionsChanged()->update(QRect()); + } -void PropertyWidget_Text::changeLang(int id) +void PropertyWidget_Text::showLineSpacing(const ParagraphStyle& newCurrent) { - if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) + if (!m_ScMW || !m_item || m_ScMW->scriptIsRunning()) return; - QStringList languageList; - LanguageManager::instance()->fillInstalledStringList(&languageList); - QString abrv = LanguageManager::instance()->getAbbrevFromLang(languageList.value(id),false); - Selection tempSelection(this, false); - tempSelection.addItem(m_item, true); - m_doc->itemSelection_SetLanguage(abrv, &tempSelection); -} -void PropertyWidget_Text::showLineSpacing(double r) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - bool inEditMode = (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable); bool tmp = m_haveItem; + double r = newCurrent.lineSpacing(); m_haveItem = false; - lineSpacing->showValue(r); - const ParagraphStyle& curStyle(m_haveItem && inEditMode ? m_item->currentStyle() : m_item->itemText.defaultStyle()); + if (tmp) { - setupLineSpacingSpinbox(curStyle.lineSpacingMode(), r); - lineSpacingModeCombo->setCurrentIndex(curStyle.lineSpacingMode()); + if (newCurrent.lineSpacingMode() == ParagraphStyle::AutomaticLineSpacing) + { + double autoLS = static_cast<double>(m_item->doc()->typographicPrefs().autoLineSpacing) / 100.0; + r = newCurrent.charStyle().font().height(newCurrent.charStyle().fontSize() / 10.0) * autoLS; + } + else if (newCurrent.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing) + r = m_item->doc()->guidesPrefs().valueBaselineGrid; + + setupLineSpacingSpinbox(newCurrent.lineSpacingMode(), r); + lineSpacingModeCombo->setCurrentIndex(newCurrent.lineSpacingMode()); } m_haveItem = tmp; } @@ -295,39 +319,11 @@ fontSize->showValue(s / 10.0); } -void PropertyWidget_Text::showLanguage(const QString& w) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - QStringList lang; - LanguageManager::instance()->fillInstalledStringList(&lang); - QString langName = LanguageManager::instance()->getLangFromAbbrev(w, true); - - bool sigBlocked = langCombo->blockSignals(true); - langCombo->setCurrentIndex(lang.indexOf(langName)); - langCombo->blockSignals(sigBlocked); -} - void PropertyWidget_Text::setupLineSpacingSpinbox(int mode, double value) { bool blocked = lineSpacing->blockSignals(true); - if (mode > 0) - { - if (mode == 1) - lineSpacing->setSpecialValueText( tr( "Auto" ) ); - if (mode == 2) - lineSpacing->setSpecialValueText( tr( "Baseline" ) ); - lineSpacing->setMinimum(0); - lineSpacing->setValue(0); - lineSpacing->setEnabled(false); - } - else - { - lineSpacing->setSpecialValueText(""); - lineSpacing->setMinimum(1); - lineSpacing->setValue(value); - lineSpacing->setEnabled(true); - } + lineSpacing->setValue(value); + lineSpacing->setEnabled((mode == 0)); lineSpacing->blockSignals(blocked); } @@ -338,7 +334,8 @@ showFontFace(charStyle.font().scName()); showFontSize(charStyle.fontSize()); - showLanguage(charStyle.language()); + showTextColors(charStyle.fillColor(), charStyle.backColor(), charStyle.strokeColor(), charStyle.fillShade(), charStyle.backShade(), charStyle.strokeShade()); + labelStrokeColor->setEnabled( (charStyle.effects() & 4) || (charStyle.effects() & 256) ); } void PropertyWidget_Text::updateStyle(const ParagraphStyle& newCurrent) @@ -347,107 +344,10 @@ return; const CharStyle& charStyle = newCurrent.charStyle(); - - showFontFace(charStyle.font().scName()); - showFontSize(charStyle.fontSize()); - showLanguage(charStyle.language()); - - if (m_item) - { - QString defaultParStyle = m_item->itemText.defaultStyle().parent(); - if (defaultParStyle.isEmpty()) - defaultParStyle = CommonStrings::DefaultParagraphStyle; - paraStyleCombo->setDefaultStyle(defaultParStyle); - } - showParStyle(newCurrent.parent()); - - if (m_item) - { - QString defaultCharStyle; - if (!newCurrent.parent().isEmpty()) - { - const ParagraphStyle* paraStyle = m_doc->paragraphStyles().getPointer(newCurrent.parent()); - if (paraStyle) - defaultCharStyle = paraStyle->charStyle().parent(); - if (defaultCharStyle.isEmpty()) - defaultCharStyle = CommonStrings::DefaultCharacterStyle; - } - if (defaultCharStyle.isEmpty()) - defaultCharStyle = m_item->itemText.defaultStyle().charStyle().parent(); - if (defaultCharStyle.isEmpty()) - defaultCharStyle = CommonStrings::DefaultCharacterStyle; - charStyleCombo->setDefaultStyle(defaultCharStyle); - } - showCharStyle(charStyle.parent()); - - bool tmp = m_haveItem; - m_haveItem = false; - - setupLineSpacingSpinbox(newCurrent.lineSpacingMode(), newCurrent.lineSpacing()); - lineSpacingModeCombo->setCurrentIndex(newCurrent.lineSpacingMode()); - textAlignment->setStyle(newCurrent.alignment(), newCurrent.direction()); - textDirection->setStyle(newCurrent.direction()); - - m_haveItem = tmp; + updateCharStyle(charStyle); + showLineSpacing(newCurrent); } -void PropertyWidget_Text::updateCharStyles() -{ - charStyleCombo->updateStyleList(); -} - -void PropertyWidget_Text::updateParagraphStyles() -{ - paraStyleCombo->updateStyleList(); - charStyleCombo->updateStyleList(); -} - -void PropertyWidget_Text::updateTextStyles() -{ - paraStyleCombo->updateStyleList(); - charStyleCombo->updateStyleList(); -} - -void PropertyWidget_Text::showAlignment(int e) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - bool tmp = m_haveItem; - m_haveItem = false; - textAlignment->setEnabled(true); - textAlignment->setStyle(e, textDirection->getStyle()); - m_haveItem = tmp; -} - -void PropertyWidget_Text::showDirection(int e) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - bool tmp = m_haveItem; - m_haveItem = false; - textDirection->setEnabled(true); - textDirection->setStyle(e); - m_haveItem = tmp; -} - -void PropertyWidget_Text::showCharStyle(const QString& name) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - bool blocked = charStyleCombo->blockSignals(true); - charStyleCombo->setStyle(name); - charStyleCombo->blockSignals(blocked); -} - -void PropertyWidget_Text::showParStyle(const QString& name) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - bool blocked = paraStyleCombo->blockSignals(true); - paraStyleCombo->setStyle(name); - paraStyleCombo->blockSignals(blocked); -} - void PropertyWidget_Text::handleLineSpacing() { if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) @@ -466,109 +366,117 @@ m_doc->itemSelection_SetFontSize(qRound(fontSize->value()*10.0), &tempSelection); } -void PropertyWidget_Text::handleAlignment(int a) +void PropertyWidget_Text::handleTextFont(const QString& font) { if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) return; Selection tempSelection(this, false); tempSelection.addItem(m_item, true); - m_doc->itemSelection_SetAlignment(a, &tempSelection); - - emit alignmentHandled(); - -// if (m_item->isPathText()) -// pathTextWidgets->handleSelectionChanged(); + m_doc->itemSelection_SetFont(font, &tempSelection); } -void PropertyWidget_Text::handleDirection(int d) +void PropertyWidget_Text::changeEvent(QEvent *e) { - if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) + if (e->type() == QEvent::LanguageChange) + { + languageChange(); return; - Selection tempSelection(this, false); - tempSelection.addItem(m_item, true); - m_doc->itemSelection_SetDirection(d, &tempSelection); - // If current text alignment is left or right, change it to match direction - if (d == ParagraphStyle::RTL && textAlignment->selectedId() == ParagraphStyle::LeftAligned) - { - m_doc->itemSelection_SetAlignment(ParagraphStyle::RightAligned, &tempSelection); - textAlignment->setTypeStyle(ParagraphStyle::RightAligned); } - else if (d == ParagraphStyle::LTR && textAlignment->selectedId() == ParagraphStyle::RightAligned) - { - m_doc->itemSelection_SetAlignment(ParagraphStyle::LeftAligned, &tempSelection); - textAlignment->setTypeStyle(ParagraphStyle::LeftAligned); - } + QWidget::changeEvent(e); } -void PropertyWidget_Text::handleTextFont(const QString& font) +void PropertyWidget_Text::languageChange() { - if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - Selection tempSelection(this, false); - tempSelection.addItem(m_item, true); - m_doc->itemSelection_SetFont(font, &tempSelection); + retranslateUi(this); + + QSignalBlocker lineSpacingModeBlocker(lineSpacingModeCombo); + int oldLineSpacingMode = lineSpacingModeCombo->currentIndex(); + lineSpacingModeCombo->clear(); + lineSpacingModeCombo->addItem( tr("Fixed")); + lineSpacingModeCombo->addItem( tr("Automatic")); + lineSpacingModeCombo->addItem( tr("Baseline")); + lineSpacingModeCombo->setCurrentIndex(oldLineSpacingMode); + + buttonTextColor->setPersistentToolTip( tr("Color of selected text")); + buttonBackgroundColor->setPersistentToolTip( tr("Background color of selected text")); + buttonStrokeColor->setPersistentToolTip( tr("Color of text stroke and/or drop shadow, depending which is chosen. If both are chosen, then they share the same color.")); + } -void PropertyWidget_Text::doClearCStyle() +void PropertyWidget_Text::handleTextFill() { - if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveDoc || !m_haveItem) + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) return; - Selection tempSelection(this, false); - tempSelection.addItem(m_item, true); - m_doc->itemSelection_EraseCharStyle(&tempSelection); + + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_blockUpdate = true; + m_doc->itemSelection_SetFillColor(buttonTextColor->colorName(), &tempSelection); + m_doc->itemSelection_SetFillShade(buttonTextColor->colorData().Shade, &tempSelection); + m_blockUpdate = false; + + } } - -void PropertyWidget_Text::doClearPStyle() +void PropertyWidget_Text::handleTextBackground() { - if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveDoc || !m_haveItem) + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) return; - UndoTransaction activeTransaction; - if (UndoManager::undoEnabled()) - activeTransaction = UndoManager::instance()->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::RemoveTextStyle, tr( "remove direct paragraph formatting" ), Um::IFont); - - Selection tempSelection(this, false); - tempSelection.addItem(m_item, true); - m_doc->itemSelection_ClearBulNumStrings(&tempSelection); - m_doc->itemSelection_EraseParagraphStyle(&tempSelection); - CharStyle emptyCStyle; - m_doc->itemSelection_SetCharStyle(emptyCStyle, &tempSelection); - - if (activeTransaction) - activeTransaction.commit(); + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) + { + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_blockUpdate = true; + m_doc->itemSelection_SetBackgroundColor(buttonBackgroundColor->colorName(), &tempSelection); + m_doc->itemSelection_SetBackgroundShade(buttonBackgroundColor->colorData().Shade, &tempSelection); + m_blockUpdate = false; + } } -void PropertyWidget_Text::changeEvent(QEvent *e) +void PropertyWidget_Text::handleTextStroke() { - if (e->type() == QEvent::LanguageChange) + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) + return; + + PageItem *i2 = m_item; + if (m_doc->appMode == modeEditTable) + i2 = m_item->asTable()->activeCell().textFrame(); + if (i2 != nullptr) { - languageChange(); - return; + Selection tempSelection(this, false); + tempSelection.addItem(i2, true); + m_blockUpdate = true; + m_doc->itemSelection_SetStrokeColor(buttonStrokeColor->colorName(), &tempSelection); + m_doc->itemSelection_SetStrokeShade(buttonStrokeColor->colorData().Shade, &tempSelection); + m_blockUpdate = false; } - QWidget::changeEvent(e); } -void PropertyWidget_Text::languageChange() +void PropertyWidget_Text::showTextColors(const QString& fillCol, const QString& backCol, const QString& strokeCol, double fillShd, double backShd, double strokeShd) { - retranslateUi(this); - QSignalBlocker lineSpacingModeBlocker(lineSpacingModeCombo); - int oldLineSpacingMode = lineSpacingModeCombo->currentIndex(); - lineSpacingModeCombo->clear(); - lineSpacingModeCombo->addItem( tr("Fixed Linespacing")); - lineSpacingModeCombo->addItem( tr("Automatic Linespacing")); - lineSpacingModeCombo->addItem( tr("Align to Baseline Grid")); - lineSpacingModeCombo->setCurrentIndex(oldLineSpacingMode); + if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning() || m_blockUpdate) + return; - QSignalBlocker langComboBlocker(langCombo); - QStringList languageList; - LanguageManager::instance()->fillInstalledStringList(&languageList); - int oldLang = langCombo->currentIndex(); - langCombo->clear(); - langCombo->addItems(languageList); - langCombo->setCurrentIndex(oldLang); + buttonTextColor->setColor(fillCol, qRound(fillShd)); + buttonTextColor->updatePreview(); + buttonTextColor->updateFloatingContext(); - textAlignment->languageChange(); - textDirection->languageChange(); + buttonBackgroundColor->setColor(backCol, qRound(backShd)); + buttonBackgroundColor->updatePreview(); + buttonBackgroundColor->updateFloatingContext(); + + buttonStrokeColor->setColor(strokeCol, qRound(strokeShd)); + buttonStrokeColor->updatePreview(); + buttonStrokeColor->updateFloatingContext(); + } Index: scribus/ui/propertywidget_text.h =================================================================== --- scribus/ui/propertywidget_text.h (Revision 26320) +++ scribus/ui/propertywidget_text.h (Arbeitskopie) @@ -5,10 +5,6 @@ #include "propertywidgetbase.h" #include <QFrame> -//namespace Ui { -//class PropertyWidget_Text; -//} - class CharStyle; class ParagraphStyle; class ScribusDoc; @@ -37,6 +33,7 @@ bool m_haveDoc {false}; bool m_haveItem {false}; + bool m_blockUpdate {false}; PageItem* m_item { nullptr }; ScribusMainWindow* m_ScMW { nullptr }; @@ -49,17 +46,13 @@ void iconSetChange(); void languageChange(); void localeChange(); - void changeLang(int id); void unitChange() {}; + void toggleLabelVisibility(bool v); - void showAlignment(int e); - void showDirection(int e); - void showCharStyle(const QString& name); void showFontFace(const QString&); void showFontSize(double s); - void showLanguage(const QString& w); - void showLineSpacing(double r); - void showParStyle(const QString& name); + void showLineSpacing(const ParagraphStyle &newCurrent); + void showTextColors(const QString& fillCol, const QString& backCol, const QString& strokeCol, double fillShd, double backShd, double strokeShd); void setupLineSpacingSpinbox(int mode, double value); @@ -66,24 +59,18 @@ void updateCharStyle(const CharStyle& charStyle); void updateStyle(const ParagraphStyle& newCurrent); - void updateCharStyles(); - void updateParagraphStyles(); - void updateTextStyles(); - void handleLineSpacingMode(int id); void handleTextFont(const QString&); + private slots: - void handleAlignment(int a); - void handleDirection(int d); + void handleFontSize(); void handleLineSpacing(); + void handleTextFill(); + void handleTextBackground(); + void handleTextStroke(); - void doClearCStyle(); - void doClearPStyle(); - -signals: - void alignmentHandled(); }; #endif // PROPERTYWIDGET_TEXT_H Index: scribus/ui/propertywidget_textcolor.cpp =================================================================== --- scribus/ui/propertywidget_textcolor.cpp (Revision 26320) +++ scribus/ui/propertywidget_textcolor.cpp (nicht existent) @@ -1,517 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ - -#include <QLocale> -#include "appmodes.h" -#include "iconmanager.h" -#include "localemgr.h" -#include "pageitem_table.h" -#include "propertywidget_textcolor.h" -#include "scribus.h" -#include "scribusapp.h" -#include "selection.h" - -PropertyWidget_TextColor::PropertyWidget_TextColor(QWidget* parent) : QFrame(parent) -{ - setupUi(this); - - layout()->setAlignment(Qt::AlignLeft); - - fillLayout->setAlignment(Qt::AlignLeft); - fillColor->setPixmapType(ColorCombo::fancyPixmaps); - fillIcon->setScaledContents( false ); - - strokeLayout->setAlignment(Qt::AlignLeft); - strokeColor->setPixmapType(ColorCombo::fancyPixmaps); - strokeIcon->setScaledContents( false ); - - backLayout->setAlignment(Qt::AlignLeft); - backColor->setPixmapType(ColorCombo::fancyPixmaps); - backIcon->setScaledContents( false ); - - effectsLayout->setAlignment(Qt::AlignLeft); - - iconSetChange(); - languageChange(); - - strokeIcon->setEnabled(false); - strokeColor->setEnabled(false); - strokeShade->setEnabled(false); - - connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); - connect(ScQApp, SIGNAL(localeChanged()), this, SLOT(localeChange())); - -} - -void PropertyWidget_TextColor::setMainWindow(ScribusMainWindow *mw) -{ - m_ScMW = mw; - - connect(m_ScMW, SIGNAL(UpdateRequest(int)), this, SLOT(handleUpdateRequest(int))); -} - -void PropertyWidget_TextColor::setDoc(ScribusDoc *d) -{ - if ((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning())) - return; - - if (m_doc) - { - disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); - disconnect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); - } - - m_doc = d; - m_item = nullptr; - - if (m_doc.isNull()) - { - disconnectSignals(); - return; - } - - updateColorList(); - - connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged())); - connect(m_doc , SIGNAL(docChanged()) , this, SLOT(handleSelectionChanged())); -} - -void PropertyWidget_TextColor::setCurrentItem(PageItem *item) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - //CB We shouldn't really need to process this if our item is the same one - //maybe we do if the item has been changed by scripter.. but that should probably - //set some status if so. - //FIXME: This won't work until when a canvas deselect happens, m_item must be nullptr. - //if (m_item == i) - // return; - - disconnectSignals(); - - m_item = item; - if (item && m_doc.isNull()) - setDoc(item->doc()); - - configureWidgets(); - - if (m_item == nullptr) - return; - if (!m_item->isTable() && !m_item->isTextFrame() && !m_item->isPathText()) - return; - - if (m_item->isTextFrame() || m_item->isPathText() || m_item->isTable()) - { - ParagraphStyle parStyle = m_item->itemText.defaultStyle(); - if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditTable) - m_item->currentTextProps(parStyle); - updateStyle(parStyle); - } - connectSignals(); -} - -void PropertyWidget_TextColor::connectSignals() -{ - connect(fillColor , SIGNAL(activated(int)), this, SLOT(handleTextFill()) , Qt::UniqueConnection); - connect(strokeColor , SIGNAL(activated(int)), this, SLOT(handleTextStroke()) , Qt::UniqueConnection); - connect(fillShade , SIGNAL(clicked()) , this, SLOT(handleTextShade()) , Qt::UniqueConnection); - connect(strokeShade , SIGNAL(clicked()) , this, SLOT(handleTextShade()) , Qt::UniqueConnection); - connect(backShade , SIGNAL(clicked()) , this, SLOT(handleTextShade()) , Qt::UniqueConnection); - connect(backColor , SIGNAL(activated(int)), this, SLOT(handleTextBackground()) , Qt::UniqueConnection); - - connect(textEffects, SIGNAL(State(int)) , this, SLOT(handleTypeStyle(int)), Qt::UniqueConnection); - connect(textEffects->ShadowVal->Xoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs()), Qt::UniqueConnection); - connect(textEffects->ShadowVal->Yoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs()), Qt::UniqueConnection); - connect(textEffects->OutlineVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleOutlineWidth()), Qt::UniqueConnection); - connect(textEffects->UnderlineVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleUnderline()) , Qt::UniqueConnection); - connect(textEffects->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(handleUnderline()) , Qt::UniqueConnection); - connect(textEffects->StrikeVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru()), Qt::UniqueConnection); - connect(textEffects->StrikeVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru()), Qt::UniqueConnection); -} - -void PropertyWidget_TextColor::disconnectSignals() -{ - disconnect(fillColor , SIGNAL(activated(int)), this, SLOT(handleTextFill())); - disconnect(strokeColor , SIGNAL(activated(int)), this, SLOT(handleTextStroke())); - disconnect(fillShade , SIGNAL(clicked()) , this, SLOT(handleTextShade())); - disconnect(strokeShade , SIGNAL(clicked()) , this, SLOT(handleTextShade())); - disconnect(backShade , SIGNAL(clicked()) , this, SLOT(handleTextShade())); - disconnect(backColor , SIGNAL(activated(int)), this, SLOT(handleTextBackground())); - - disconnect(textEffects, SIGNAL(State(int)) , this, SLOT(handleTypeStyle(int))); - disconnect(textEffects->ShadowVal->Xoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs())); - disconnect(textEffects->ShadowVal->Yoffset , SIGNAL(valueChanged(double)), this, SLOT(handleShadowOffs())); - disconnect(textEffects->OutlineVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleOutlineWidth())); - disconnect(textEffects->UnderlineVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleUnderline())); - disconnect(textEffects->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(handleUnderline())); - disconnect(textEffects->StrikeVal->LPos , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru())); - disconnect(textEffects->StrikeVal->LWidth , SIGNAL(valueChanged(double)), this, SLOT(handleStrikeThru())); -} - -void PropertyWidget_TextColor::configureWidgets() -{ - bool enabled = false; - if (m_item && m_doc) - { - if (m_item->isPathText() || m_item->isTextFrame() || m_item->isTable()) - enabled = true; - if ((m_item->isGroup()) && (!m_item->isSingleSel)) - enabled = false; - if (m_item->isOSGFrame() || m_item->isSymbol()) - enabled = false; - if (m_doc->m_Selection->count() > 1) - enabled = false; - } - setEnabled(enabled); -} - -void PropertyWidget_TextColor::handleSelectionChanged() -{ - if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - - PageItem* currItem = currentItemFromSelection(); - setCurrentItem(currItem); - updateGeometry(); -} - -void PropertyWidget_TextColor::handleUpdateRequest(int updateFlags) -{ - if (updateFlags & reqColorsUpdate) - updateColorList(); -} - -void PropertyWidget_TextColor::updateColorList() -{ - if (!m_doc || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - - if (m_item) - disconnectSignals(); - - fillColor->setColors(m_doc->PageColors, true); - strokeColor->setColors(m_doc->PageColors, false); - backColor->setColors(m_doc->PageColors, true); - - if (m_item) - setCurrentItem(m_item); -} - -void PropertyWidget_TextColor::updateCharStyle(const CharStyle& charStyle) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - - showOutlineW (charStyle.outlineWidth()); - showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset()); - showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.backColor(), charStyle.strokeShade(), charStyle.fillShade(), charStyle.backShade()); - showTextEffects(charStyle.effects()); - showStrikeThru(charStyle.strikethruOffset() , charStyle.strikethruWidth()); - showUnderline (charStyle.underlineOffset(), charStyle.underlineWidth()); -} - -void PropertyWidget_TextColor::updateStyle(const ParagraphStyle& newCurrent) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - - const CharStyle& charStyle = newCurrent.charStyle(); - - showOutlineW (charStyle.outlineWidth()); - showShadowOffset(charStyle.shadowXOffset(), charStyle.shadowYOffset()); - showTextColors(charStyle.strokeColor(), charStyle.fillColor(), charStyle.backColor(), charStyle.strokeShade(), charStyle.fillShade(), charStyle.backShade()); - showTextEffects(charStyle.effects()); - showStrikeThru(charStyle.strikethruOffset() , charStyle.strikethruWidth()); - showUnderline (charStyle.underlineOffset(), charStyle.underlineWidth()); -} - -void PropertyWidget_TextColor::showOutlineW(double x) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - textEffects->OutlineVal->LWidth->showValue(x / 10.0); -} - -void PropertyWidget_TextColor::showShadowOffset(double x, double y) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - textEffects->ShadowVal->Xoffset->showValue(x / 10.0); - textEffects->ShadowVal->Yoffset->showValue(y / 10.0); -} - -void PropertyWidget_TextColor::showStrikeThru(double p, double w) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - textEffects->StrikeVal->LPos->showValue(p / 10.0); - textEffects->StrikeVal->LWidth->showValue(w / 10.0); -} - -void PropertyWidget_TextColor::showTextColors(const QString& strokeCol, const QString& fillCol, const QString& backCol, double strokeShd, double fillShd, double backShd) -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - - QSignalBlocker fillShadeBlocker(fillShade); - QSignalBlocker strokeShadeBlocker(strokeShade); - QSignalBlocker backShadeBlocker(backShade); - QSignalBlocker fillColorBlocker(fillColor); - QSignalBlocker strokeColorBlocker(strokeColor); - QSignalBlocker backColorBlocker(backColor); - - fillShade->setValue(qRound(fillShd)); - strokeShade->setValue(qRound(strokeShd)); - backShade->setValue(qRound(backShd)); - - if (!fillCol.isEmpty()) - fillColor->setCurrentColor(fillCol); - if (!strokeCol.isEmpty()) - strokeColor->setCurrentColor(strokeCol); - if (!backCol.isEmpty()) - backColor->setCurrentColor(backCol); -} - -void PropertyWidget_TextColor::showTextEffects(int s) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - strokeIcon->setEnabled(false); - strokeColor->setEnabled(false); - strokeShade->setEnabled(false); - textEffects->setStyle(s); - if ((s & 4) || (s & 256)) - { - strokeIcon->setEnabled(true); - strokeColor->setEnabled(true); - strokeShade->setEnabled(true); - } -} - -void PropertyWidget_TextColor::handleOutlineWidth() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - int x = qRound(textEffects->OutlineVal->LWidth->value() * 10.0); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetOutlineWidth(x, &tempSelection); - } -} - -void PropertyWidget_TextColor::handleShadowOffs() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - int x = qRound(textEffects->ShadowVal->Xoffset->value() * 10.0); - int y = qRound(textEffects->ShadowVal->Yoffset->value() * 10.0); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetShadowOffsets(x, y, &tempSelection); - } -} - -void PropertyWidget_TextColor::handleStrikeThru() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - int x = qRound(textEffects->StrikeVal->LPos->value() * 10.0); - int y = qRound(textEffects->StrikeVal->LWidth->value() * 10.0); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetStrikethru(x, y, &tempSelection); - } -} - -void PropertyWidget_TextColor::handleTextFill() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetFillColor(fillColor->currentColor(), &tempSelection); - } -} - -void PropertyWidget_TextColor::handleTextStroke() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetStrokeColor(strokeColor->currentColor(), &tempSelection); - } -} - -void PropertyWidget_TextColor::handleTextBackground() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetBackgroundColor(backColor->currentColor(), &tempSelection); - } -} - -void PropertyWidget_TextColor::handleTextShade() -{ - if (!m_doc || !m_item || !m_ScMW || m_ScMW->scriptIsRunning()) - return; - if (strokeShade == sender()) - { - int b = strokeShade->getValue(); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetStrokeShade(b, &tempSelection); - } - } - else if (fillShade == sender()) - { - int b = fillShade->getValue(); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetFillShade(b, &tempSelection); - } - } - else if (backShade == sender()) - { - int b = backShade->getValue(); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetBackgroundShade(b, &tempSelection); - } - } -} - -void PropertyWidget_TextColor::handleTypeStyle(int s) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetEffects(s, &tempSelection); - m_ScMW->setStyleEffects(s); - } -} - -void PropertyWidget_TextColor::showUnderline(double p, double w) -{ - if (!m_ScMW || m_ScMW->scriptIsRunning()) - return; - textEffects->UnderlineVal->LPos->showValue(p / 10.0); - textEffects->UnderlineVal->LWidth->showValue(w / 10.0); -} - -void PropertyWidget_TextColor::handleUnderline() -{ - if ((m_doc) && (m_item)) - { - int x = qRound(textEffects->UnderlineVal->LPos->value() * 10.0); - int y = qRound(textEffects->UnderlineVal->LWidth->value() * 10.0); - PageItem *i2 = m_item; - if (m_doc->appMode == modeEditTable) - i2 = m_item->asTable()->activeCell().textFrame(); - if (i2 != nullptr) - { - Selection tempSelection(this, false); - tempSelection.addItem(i2, true); - m_doc->itemSelection_SetUnderline(x, y, &tempSelection); - } - } -} - -void PropertyWidget_TextColor::changeEvent(QEvent *e) -{ - if (e->type() == QEvent::LanguageChange) - { - languageChange(); - return; - } - QWidget::changeEvent(e); -} - -void PropertyWidget_TextColor::iconSetChange() -{ - IconManager& iconManager = IconManager::instance(); - - fillIcon->setPixmap(iconManager.loadPixmap("16/color-fill.png")); - fillShadeLabel->setPixmap(iconManager.loadPixmap("shade.png")); - - strokeIcon->setPixmap(iconManager.loadPixmap("16/color-stroke.png")); - strokeShadeLabel->setPixmap(iconManager.loadPixmap("shade.png")); - - backIcon->setPixmap(iconManager.loadPixmap("16/color-fill.png")); - backShadeLabel->setPixmap(iconManager.loadPixmap("shade.png")); -} - -void PropertyWidget_TextColor::languageChange() -{ - retranslateUi(this); - textEffects->languageChange(); -} - -void PropertyWidget_TextColor::localeChange() -{ - const QLocale& l(LocaleManager::instance().userPreferredLocale()); - textEffects->ShadowVal->Xoffset->setLocale(l); - textEffects->ShadowVal->Yoffset->setLocale(l); - textEffects->OutlineVal->LWidth->setLocale(l); - textEffects->UnderlineVal->LPos->setLocale(l); - textEffects->UnderlineVal->LWidth->setLocale(l); - textEffects->StrikeVal->LPos->setLocale(l); - textEffects->StrikeVal->LWidth->setLocale(l); -} Index: scribus/ui/propertywidget_textcolor.h =================================================================== --- scribus/ui/propertywidget_textcolor.h (Revision 26320) +++ scribus/ui/propertywidget_textcolor.h (nicht existent) @@ -1,74 +0,0 @@ -/* -For general Scribus (>=1.3.2) copyright and licensing information please refer -to the COPYING file provided with the program. Following this notice may exist -a copyright and/or license notice that predates the release of Scribus 1.3.2 -for which a new license (GPL+exception) is in place. -*/ -#ifndef PROPERTYWIDGET_TEXTCOLOR_H -#define PROPERTYWIDGET_TEXTCOLOR_H - -#include "ui_propertywidget_textcolorbase.h" - -#include "propertywidgetbase.h" - -class ScribusDoc; -class ScribusMainWindow; - -class PropertyWidget_TextColor : public QFrame, Ui::PropertyWidget_TextColorBase, - public PropertyWidgetBase -{ - Q_OBJECT - -public: - PropertyWidget_TextColor(QWidget* parent); - ~PropertyWidget_TextColor() {}; - - void updateColorList(); - void setCurrentItem(PageItem *item); - -protected: - PageItem *m_item {nullptr}; - ScribusMainWindow* m_ScMW {nullptr}; - - void connectSignals(); - void disconnectSignals(); - - void configureWidgets(); - - void changeEvent(QEvent *e) override; - -public slots: - void setMainWindow(ScribusMainWindow *mw); - void setDoc(ScribusDoc *d); - - void handleSelectionChanged(); - void handleUpdateRequest(int); - - void iconSetChange(); - void languageChange(); - void unitChange() {}; - void localeChange(); - - void showOutlineW(double x); - void showShadowOffset(double x, double y); - void showStrikeThru(double p, double w); - void showTextColors(const QString& strokeCol, const QString& fillCol, const QString& backCol, double strokeShd, double fillShd, double backShd); - void showTextEffects(int s); - void showUnderline(double p, double w); - - void updateCharStyle(const CharStyle& charStyle); - void updateStyle(const ParagraphStyle& newCurrent); - -private slots: - void handleOutlineWidth(); - void handleShadowOffs(); - void handleStrikeThru(); - void handleTextFill(); - void handleTextShade(); - void handleTextStroke(); - void handleTextBackground(); - void handleTypeStyle(int s); - void handleUnderline(); -}; - -#endif Index: scribus/ui/propertywidget_textcolorbase.ui =================================================================== --- scribus/ui/propertywidget_textcolorbase.ui (Revision 26320) +++ scribus/ui/propertywidget_textcolorbase.ui (nicht existent) @@ -1,281 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>PropertyWidget_TextColorBase</class> - <widget class="QFrame" name="PropertyWidget_TextColorBase"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>167</width> - <height>135</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>3</number> - </property> - <property name="topMargin"> - <number>3</number> - </property> - <property name="rightMargin"> - <number>3</number> - </property> - <property name="bottomMargin"> - <number>3</number> - </property> - <item> - <layout class="QHBoxLayout" name="fillLayout"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <widget class="QLabel" name="fillIcon"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ColorCombo" name="fillColor"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Color of selected text. If Outline text decoration is enabled, this color will be the fill color.<br/>If Drop Shadow Text is enabled, then this will be the top most color.</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="fillShadeLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ShadeButton" name="fillShade"> - <property name="toolTip"> - <string>Saturation of color of text fill</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="strokeLayout"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <widget class="QLabel" name="strokeIcon"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ColorCombo" name="strokeColor"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="tabletTracking"> - <bool>true</bool> - </property> - <property name="toolTip"> - <string>Color of text stroke and/or drop shadow, depending which is chosen.<br/>If both are chosen, then they share the same color.</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="strokeShadeLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ShadeButton" name="strokeShade"> - <property name="toolTip"> - <string>Saturation of color of text stroke</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="backLayout"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <widget class="QLabel" name="backIcon"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ColorCombo" name="backColor"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip"> - <string>Background color of selected text</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="backShadeLabel"> - <property name="minimumSize"> - <size> - <width>20</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>22</width> - <height>22</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="ShadeButton" name="backShade"> - <property name="toolTip"> - <string>Saturation of color of text background</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="effectsLayout"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="StyleSelect" name="textEffects" native="true"/> - </item> - </layout> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>ColorCombo</class> - <extends>QComboBox</extends> - <header>ui/colorcombo.h</header> - </customwidget> - <customwidget> - <class>ShadeButton</class> - <extends>QToolButton</extends> - <header>ui/shadebutton.h</header> - </customwidget> - <customwidget> - <class>StyleSelect</class> - <extends>QWidget</extends> - <header>ui/styleselect.h</header> - <container>1</container> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui> Index: scribus/ui/smalignselect.cpp =================================================================== --- scribus/ui/smalignselect.cpp (Revision 26320) +++ scribus/ui/smalignselect.cpp (Arbeitskopie) @@ -6,18 +6,22 @@ */ #include <QToolTip> #include "smalignselect.h" +#include "iconmanager.h" +#include "scribusapp.h" - SMAlignSelect::SMAlignSelect(QWidget *parent) : AlignSelect(parent) { parentButton = new QToolButton(this); - parentButton->setCheckable( true ); - parentButton->setText( tr("P", "P as in Parent")); + parentButton->setText( ""); parentButton->setToolTip( tr("Use parent style's alignment instead of overriding it")); - GroupAlignLayout->addWidget( parentButton ); + addWidget( parentButton ); resize(minimumSizeHint()); parentButton->hide(); + + iconSetChange(); + + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); } void SMAlignSelect::setStyle(int a, int d) @@ -24,7 +28,6 @@ { disconnect(this, SIGNAL(State(int)), this, SLOT(styleChanged())); disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed())); - setFont(false); m_hasParent = false; m_pStyle = 0; m_pDirection = 0; @@ -39,7 +42,6 @@ m_hasParent = true; m_pStyle = a; m_pDirection = d; - setFont(!isParentValue); if (isParentValue) parentButton->hide(); else @@ -67,20 +69,10 @@ return ret; } -void SMAlignSelect::setFont(bool wantBold) -{ - QFont f(font()); - f.setBold(wantBold); - parentButton->setFont(f); -} - void SMAlignSelect::styleChanged() { if (m_hasParent) - { - setFont(true); parentButton->show(); - } } void SMAlignSelect::pbPressed() @@ -87,3 +79,9 @@ { m_useParentStyle = true; } + +void SMAlignSelect::iconSetChange() +{ + IconManager &im = IconManager::instance(); + parentButton->setIcon(im.loadIcon("reset-style-changes")); +} Index: scribus/ui/smalignselect.h =================================================================== --- scribus/ui/smalignselect.h (Revision 26320) +++ scribus/ui/smalignselect.h (Arbeitskopie) @@ -31,11 +31,10 @@ int m_pStyle = 0; int m_pDirection = 0; - void setFont(bool wantBold); - private slots: void styleChanged(); void pbPressed(); + void iconSetChange(); }; #endif Index: scribus/ui/smcstylewidget.cpp =================================================================== --- scribus/ui/smcstylewidget.cpp (Revision 26320) +++ scribus/ui/smcstylewidget.cpp (Arbeitskopie) @@ -6,6 +6,7 @@ */ #include <QEvent> +#include <QListView> #include "iconmanager.h" #include "langmgr.h" @@ -24,25 +25,40 @@ iconSetChange(); - fillColor_->setPixmapType(ColorCombo::fancyPixmaps); - fillColor_->clear(); - fillColor_->addItem(CommonStrings::tr_NoneColor); + // fillColor_->setPixmapType(ColorCombo::fancyPixmaps); + // fillColor_->clear(); + // fillColor_->addItem(CommonStrings::tr_NoneColor); - strokeColor_->setPixmapType(ColorCombo::fancyPixmaps); - strokeColor_->clear(); - strokeColor_->addItem(CommonStrings::tr_NoneColor); + // strokeColor_->setPixmapType(ColorCombo::fancyPixmaps); + // strokeColor_->clear(); + // strokeColor_->addItem(CommonStrings::tr_NoneColor); - backColor_->setPixmapType(ColorCombo::fancyPixmaps); - backColor_->clear(); - backColor_->addItem(CommonStrings::tr_NoneColor); + // backColor_->setPixmapType(ColorCombo::fancyPixmaps); + // backColor_->clear(); + // backColor_->addItem(CommonStrings::tr_NoneColor); - StrokeIcon->setEnabled(false); - strokeShade_->setEnabled(false); - strokeColor_->setEnabled(false); + textColor->colorButton->setContext(Context::Text); + textColor->setColor(CommonStrings::tr_NoneColor); + textColor->setText(tr("Color")); + + backgroundColor->colorButton->setContext(Context::TextBackground); + backgroundColor->setColor(CommonStrings::tr_NoneColor); + backgroundColor->setText(tr("Background")); + + strokeColor->colorButton->setContext(Context::TextOutline); + strokeColor->setColor(CommonStrings::tr_NoneColor); + strokeColor->setText(tr("Stroke")); + strokeColor->setEnabled(false); + + // StrokeIcon->setEnabled(false); + // strokeShade_->setEnabled(false); + // strokeColor_->setEnabled(false); fontfeaturesSetting->resetFontFeatures(); hyphenCharLineEdit->setMaxLength(1); + fontFace_->setGuestWidget(fontSizeLabel_); + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); connect(effects_, SIGNAL(State(int)), this, SLOT(slotColorChange())); @@ -63,18 +79,21 @@ { IconManager& im = IconManager::instance(); - fontSizeLabel_->setPixmap(im.loadPixmap("zeichen.png")); - trackingLabel_->setPixmap(im.loadPixmap("textkern.png")); - widthSpaceLabel->setPixmap(im.loadPixmap("spacewidth.png")); - baselineOffsetLabel_->setPixmap(im.loadPixmap("textbase.png")); - hscaleLabel_->setPixmap(im.loadPixmap("textscaleh.png")); - vscaleLabel_->setPixmap(im.loadPixmap("textscalev.png")); - FillIcon->setPixmap(im.loadPixmap("16/color-fill.png")); - fillShadeLabel->setPixmap(im.loadPixmap("shade.png")); - StrokeIcon->setPixmap(im.loadPixmap("16/color-stroke.png")); - strokeShadeLabel->setPixmap(im.loadPixmap("shade.png")); - backIcon->setPixmap(im.loadPixmap("16/color-fill.png")); - backShadeLabel->setPixmap(im.loadPixmap("shade.png")); + fontSizeLabel_->setPixmap(im.loadPixmap("font-size")); + trackingLabel_->setPixmap(im.loadPixmap("character-letter-tracking")); + widthSpaceLabel->setPixmap(im.loadPixmap("character-space-width")); + baselineOffsetLabel_->setPixmap(im.loadPixmap("character-offset-baseline")); + hscaleLabel_->setPixmap(im.loadPixmap("character-scale-width")); + vscaleLabel_->setPixmap(im.loadPixmap("character-scale-height")); + // FillIcon->setPixmap(im.loadPixmap("16/color-fill.png")); + // fillShadeLabel->setPixmap(im.loadPixmap("shade.png")); + // StrokeIcon->setPixmap(im.loadPixmap("16/color-stroke.png")); + // strokeShadeLabel->setPixmap(im.loadPixmap("shade.png")); + // backIcon->setPixmap(im.loadPixmap("16/color-fill.png")); + // backShadeLabel->setPixmap(im.loadPixmap("shade.png")); + languageLabel_->setPixmap(im.loadPixmap("paragraph-language")); + hyphenationCharacterLabel->setPixmap(im.loadPixmap("hyphen-character")); + smallestWordLabel->setPixmap(im.loadPixmap("hyphen-smallest-word")); } void SMCStyleWidget::languageChange() @@ -83,26 +102,26 @@ LanguageManager::instance()->fillInstalledStringList(&languageList); fillLangComboFromList(languageList); - if (fillColor_->count() > 0) - { - bool sigBlocked = fillColor_->blockSignals(true); - fillColor_->setItemText(0, CommonStrings::tr_NoneColor); - fillColor_->blockSignals(sigBlocked); - } + // if (fillColor_->count() > 0) + // { + // bool sigBlocked = fillColor_->blockSignals(true); + // fillColor_->setItemText(0, CommonStrings::tr_NoneColor); + // fillColor_->blockSignals(sigBlocked); + // } - if (strokeColor_->count() > 0) - { - bool sigBlocked = strokeColor_->blockSignals(true); - strokeColor_->setItemText(0, CommonStrings::tr_NoneColor); - strokeColor_->blockSignals(sigBlocked); - } + // if (strokeColor_->count() > 0) + // { + // bool sigBlocked = strokeColor_->blockSignals(true); + // strokeColor_->setItemText(0, CommonStrings::tr_NoneColor); + // strokeColor_->blockSignals(sigBlocked); + // } - if (backColor_->count() > 0) - { - bool sigBlocked = backColor_->blockSignals(true); - backColor_->setItemText(0, CommonStrings::tr_NoneColor); - backColor_->blockSignals(sigBlocked); - } + // if (backColor_->count() > 0) + // { + // bool sigBlocked = backColor_->blockSignals(true); + // backColor_->setItemText(0, CommonStrings::tr_NoneColor); + // backColor_->blockSignals(sigBlocked); + // } retranslateUi(this); @@ -112,13 +131,22 @@ baselineOffsetLabel_->setToolTip(baselineOffset_->toolTip()); hscaleLabel_->setToolTip(fontHScale_->toolTip()); vscaleLabel_->setToolTip(fontVScale_->toolTip()); - FillIcon->setToolTip(fillColor_->toolTip()); - fillShadeLabel->setToolTip(fillShade_->toolTip()); - StrokeIcon->setToolTip(strokeColor_->toolTip()); - strokeShadeLabel->setToolTip(strokeShade_->toolTip()); - backIcon->setToolTip(backColor_->toolTip()); - backShadeLabel->setToolTip(backShade_->toolTip()); + // FillIcon->setToolTip(fillColor_->toolTip()); + // fillShadeLabel->setToolTip(fillShade_->toolTip()); + // StrokeIcon->setToolTip(strokeColor_->toolTip()); + // strokeShadeLabel->setToolTip(strokeShade_->toolTip()); + // backIcon->setToolTip(backColor_->toolTip()); + // backShadeLabel->setToolTip(backShade_->toolTip()); + textColor->colorButton->setPersistentToolTip( tr("Text color of selected text")); + textColor->setText(tr("Color")); + + backgroundColor->colorButton->setPersistentToolTip( tr("Background color of selected text")); + backgroundColor->setText(tr("Background")); + + strokeColor->colorButton->setPersistentToolTip( tr("Stroke color of selected text")); + strokeColor->setText(tr("Stroke")); + // fontVScale_->setSuffix( tr(" %")); // fontHScale_->setSuffix( tr(" %")); // baselineOffset_->setSuffix( tr(" %")); @@ -158,23 +186,23 @@ tmpView->setMinimumWidth(tmpWidth + 24); } -void SMCStyleWidget::fillColorCombo(ColorList &colors) -{ - fillColor_->clear(); - strokeColor_->clear(); - backColor_->clear(); +// void SMCStyleWidget::fillColorCombo(ColorList &colors) +// { +// fillColor_->clear(); +// strokeColor_->clear(); +// backColor_->clear(); - fillColor_->setColors(colors, true); - strokeColor_->setColors(colors, true); - backColor_->setColors(colors, true); -} +// fillColor_->setColors(colors, true); +// strokeColor_->setColors(colors, true); +// backColor_->setColors(colors, true); +// } void SMCStyleWidget::handleUpdateRequest(int updateFlags) { if (!m_Doc) return; - if (updateFlags & reqColorsUpdate) - fillColorCombo(m_Doc->PageColors); + // if (updateFlags & reqColorsUpdate) + // fillColorCombo(m_Doc->PageColors); } void SMCStyleWidget::slotEnableFontFeatures(const QString& s) @@ -195,9 +223,13 @@ QStringList languageList; LanguageManager::instance()->fillInstalledStringList(&languageList); fillLangComboFromList(languageList); - fillColorCombo(m_Doc->PageColors); +// fillColorCombo(m_Doc->PageColors); fontFace_->rebuildList(m_Doc); + textColor->colorButton->setDoc(m_Doc); + backgroundColor->colorButton->setDoc(m_Doc); + strokeColor->colorButton->setDoc(m_Doc); + connect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int))); } @@ -230,24 +262,28 @@ effects_->setStyle(static_cast<int>(cstyle->effects()), cstyle->isInhFeatures()); effects_->setParentItem(static_cast<int>(parent->effects())); // FIXME - fillShade_->setValue(qRound(cstyle->fillShade()), cstyle->isInhFillShade()); - fillShade_->setParentValue(qRound(parent->fillShade())); + // fillShade_->setValue(qRound(cstyle->fillShade()), cstyle->isInhFillShade()); + // fillShade_->setParentValue(qRound(parent->fillShade())); - strokeShade_->setValue(qRound(cstyle->strokeShade()), cstyle->isInhStrokeShade()); - strokeShade_->setParentValue(qRound(parent->strokeShade())); + // strokeShade_->setValue(qRound(cstyle->strokeShade()), cstyle->isInhStrokeShade()); + // strokeShade_->setParentValue(qRound(parent->strokeShade())); - fillColor_->setCurrentText(cstyle->fillColor(), cstyle->isInhFillColor()); - fillColor_->setParentText(parent->fillColor()); + // fillColor_->setCurrentText(cstyle->fillColor(), cstyle->isInhFillColor()); + // fillColor_->setParentText(parent->fillColor()); - strokeColor_->setCurrentText(cstyle->strokeColor(), cstyle->isInhStrokeColor()); - strokeColor_->setParentText(parent->strokeColor()); + // strokeColor_->setCurrentText(cstyle->strokeColor(), cstyle->isInhStrokeColor()); + // strokeColor_->setParentText(parent->strokeColor()); - backColor_->setCurrentText(cstyle->backColor(), cstyle->isInhBackColor()); - backColor_->setParentText(parent->backColor()); + // backColor_->setCurrentText(cstyle->backColor(), cstyle->isInhBackColor()); + // backColor_->setParentText(parent->backColor()); - backShade_->setValue(qRound(cstyle->backShade()), cstyle->isInhBackShade()); - backShade_->setParentValue(qRound(parent->backShade())); + // backShade_->setValue(qRound(cstyle->backShade()), cstyle->isInhBackShade()); + // backShade_->setParentValue(qRound(parent->backShade())); + textColor->setColor(cstyle->fillColor(), qRound(cstyle->fillShade()), parent->fillColor(), qRound(cstyle->fillShade()), cstyle->isInhFillColor()); + backgroundColor->setColor(cstyle->backColor(), qRound(cstyle->backShade()), parent->backColor(), qRound(cstyle->backShade()), cstyle->isInhBackColor()); + strokeColor->setColor(cstyle->strokeColor(), qRound(cstyle->strokeShade()), parent->strokeColor(), qRound(cstyle->strokeShade()), cstyle->isInhStrokeColor()); + fontFace_->setCurrentFont(cstyle->font().scName(), cstyle->isInhFont()); fontFace_->setParentFont(parent->font().scName()); @@ -278,12 +314,17 @@ tracking_->setValue(cstyle->tracking() / 10.0); widthSpaceSpin->setValue(cstyle->wordTracking() * 100.0); effects_->setStyle(static_cast<int>(cstyle->effects())); - fillShade_->setValue(qRound(cstyle->fillShade())); - strokeShade_->setValue(qRound(cstyle->strokeShade())); - fillColor_->setCurrentText(cstyle->fillColor()); - strokeColor_->setCurrentText(cstyle->strokeColor()); - backColor_->setCurrentText(cstyle->backColor()); - backShade_->setValue(qRound(cstyle->backShade())); + // fillShade_->setValue(qRound(cstyle->fillShade())); + // strokeShade_->setValue(qRound(cstyle->strokeShade())); + // fillColor_->setCurrentText(cstyle->fillColor()); + // strokeColor_->setCurrentText(cstyle->strokeColor()); + // backColor_->setCurrentText(cstyle->backColor()); + // backShade_->setValue(qRound(cstyle->backShade())); + + textColor->setColor(cstyle->fillColor(), qRound(cstyle->fillShade())); + backgroundColor->setColor(cstyle->backColor(), qRound(cstyle->backShade())); + strokeColor->setColor(cstyle->strokeColor(), qRound(cstyle->strokeShade())); + fontFace_->setCurrentFont(cstyle->font().scName()); fontfeaturesSetting->setFontFeatures(cstyle->fontFeatures(), cstyle->font().fontFeatures()); smallestWordSpinBox->setValue(cstyle->hyphenWordMin()); @@ -509,8 +550,9 @@ void SMCStyleWidget::showColors(const QList<CharStyle*> &cstyles) { - strokeShade_->setEnabled(true); - strokeColor_->setEnabled(true); + // strokeShade_->setEnabled(true); + // strokeColor_->setEnabled(true); + strokeColor->setEnabled(true); double d = -30000; for (int i = 0; i < cstyles.count(); ++i) @@ -522,84 +564,90 @@ } d = cstyles[i]->fillShade(); } - if (d == -30000) - fillShade_->setText( tr("Shade")); - else - fillShade_->setValue(qRound(d)); + // if (d == -30000) + // fillShade_->setText( tr("Shade")); + // else + // fillShade_->setValue(qRound(d)); - d = -30000; + QString s; for (int i = 0; i < cstyles.count(); ++i) { - if (d != -30000 && cstyles[i]->strokeShade() != d) + if (!s.isEmpty() && s != cstyles[i]->fillColor()) { - d = -30000; + s.clear(); break; } - d = cstyles[i]->strokeShade(); + s = cstyles[i]->fillColor(); } - if (d == -30000) - { - strokeShade_->setValue(21); - strokeShade_->setText( tr("Shade")); - } - else - strokeShade_->setValue(qRound(d)); + // if (s.isEmpty()) + // { + // if (fillColor_->itemText(fillColor_->count() - 1) != "") + // fillColor_->addItem(""); + // fillColor_->setCurrentIndex(fillColor_->count() - 1); + // } + // else + // fillColor_->setCurrentText(s); + textColor->setColor(s, qRound(d)); + + // Stroke d = -30000; for (int i = 0; i < cstyles.count(); ++i) { - if (d != -30000 && cstyles[i]->backShade() != d) + if (d != -30000 && cstyles[i]->strokeShade() != d) { d = -30000; break; } - d = cstyles[i]->backShade(); + d = cstyles[i]->strokeShade(); } - if (d == -30000) - { - backShade_->setValue(21); - backShade_->setText( tr("Shade")); - } - else - backShade_->setValue(qRound(d)); + // if (d == -30000) + // { + // strokeShade_->setValue(21); + // strokeShade_->setText( tr("Shade")); + // } + // else + // strokeShade_->setValue(qRound(d)); - QString s; + s.clear(); for (int i = 0; i < cstyles.count(); ++i) { - if (!s.isEmpty() && s != cstyles[i]->fillColor()) + if (!s.isEmpty() && s != cstyles[i]->strokeColor()) { s.clear(); break; } - s = cstyles[i]->fillColor(); + s = cstyles[i]->strokeColor(); } - if (s.isEmpty()) - { - if (fillColor_->itemText(fillColor_->count() - 1) != "") - fillColor_->addItem(""); - fillColor_->setCurrentIndex(fillColor_->count() - 1); - } - else - fillColor_->setCurrentText(s); + // if (s.isEmpty()) + // { + // if (strokeColor_->itemText(strokeColor_->count() - 1) != "") + // strokeColor_->addItem(""); + // strokeColor_->setCurrentIndex(strokeColor_->count() - 1); + // } + // else + // strokeColor_->setCurrentText(s); - s.clear(); + strokeColor->setColor(s, qRound(d)); + + // Background + d = -30000; for (int i = 0; i < cstyles.count(); ++i) { - if (!s.isEmpty() && s != cstyles[i]->strokeColor()) + if (d != -30000 && cstyles[i]->backShade() != d) { - s.clear(); + d = -30000; break; } - s = cstyles[i]->strokeColor(); + d = cstyles[i]->backShade(); } - if (s.isEmpty()) - { - if (strokeColor_->itemText(strokeColor_->count() - 1) != "") - strokeColor_->addItem(""); - strokeColor_->setCurrentIndex(strokeColor_->count() - 1); - } - else - strokeColor_->setCurrentText(s); + // if (d == -30000) + // { + // backShade_->setValue(21); + // backShade_->setText( tr("Shade")); + // } + // else + // backShade_->setValue(qRound(d)); s.clear(); for (int i = 0; i < cstyles.count(); ++i) @@ -611,14 +659,17 @@ } s = cstyles[i]->backColor(); } - if (s.isEmpty()) - { - if (backColor_->itemText(backColor_->count() - 1) != "") - backColor_->addItem(""); - backColor_->setCurrentIndex(backColor_->count() - 1); - } - else - backColor_->setCurrentText(s); + // if (s.isEmpty()) + // { + // if (backColor_->itemText(backColor_->count() - 1) != "") + // backColor_->addItem(""); + // backColor_->setCurrentIndex(backColor_->count() - 1); + // } + // else + // backColor_->setCurrentText(s); + + backgroundColor->setColor(s, qRound(d)); + } void SMCStyleWidget::showLanguage(const QList<CharStyle*> &cstyles, const QString& /*defLang*/) @@ -713,7 +764,9 @@ { int s = effects_->getStyle(); bool enabled= (s & 4) || (s & 256); - StrokeIcon->setEnabled(enabled); - strokeShade_->setEnabled(enabled); - strokeColor_->setEnabled(enabled); + // StrokeIcon->setEnabled(enabled); + // strokeShade_->setEnabled(enabled); + // strokeColor_->setEnabled(enabled); + + strokeColor->setEnabled(enabled); } Index: scribus/ui/smcstylewidget.h =================================================================== --- scribus/ui/smcstylewidget.h (Revision 26320) +++ scribus/ui/smcstylewidget.h (Arbeitskopie) @@ -27,7 +27,7 @@ void show(const QList<CharStyle*> &cstyles, const QList<CharStyle> &cstylesAll, const QString &defLang, int unitIndex); //void fillLangCombo(QMap<QString,QString> langMap); void fillLangComboFromList(const QStringList& langList); - void fillColorCombo(ColorList &colors); +// void fillColorCombo(ColorList &colors); void languageChange(); void clearAll(); Index: scribus/ui/smdirectionselect.cpp =================================================================== --- scribus/ui/smdirectionselect.cpp (Revision 26320) +++ scribus/ui/smdirectionselect.cpp (Arbeitskopie) @@ -1,15 +1,20 @@ #include "smdirectionselect.h" +#include "iconmanager.h" +#include "scribusapp.h" SMDirectionSelect::SMDirectionSelect(QWidget *parent) : DirectionSelect(parent) { parentButton = new QToolButton(this); - parentButton->setCheckable( true ); - parentButton->setText( tr("P", "P as in Parent")); + parentButton->setText( "" ); parentButton->setToolTip( tr("Use parent style's direction instead of overriding it")); - groupSelectLayout->addWidget( parentButton ); + addWidget( parentButton ); resize(minimumSizeHint()); parentButton->hide(); + + iconSetChange(); + + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); } void SMDirectionSelect::setStyle(int i) @@ -16,7 +21,6 @@ { disconnect(this, SIGNAL(State(int)), this, SLOT(styleChanged())); disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed())); - setFont(false); m_hasParent = false; m_pStyle = 0; parentButton->hide(); @@ -29,7 +33,6 @@ disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed())); m_hasParent = true; m_pStyle = i; - setFont(!isParentValue); if (isParentValue) parentButton->hide(); else @@ -56,20 +59,10 @@ return ret; } -void SMDirectionSelect::setFont(bool wantBold) -{ - QFont f(font()); - f.setBold(wantBold); - parentButton->setFont(f); -} - void SMDirectionSelect::styleChanged() { if (m_hasParent) - { - setFont(true); parentButton->show(); - } } void SMDirectionSelect::pbPressed() @@ -76,3 +69,9 @@ { m_useParentStyle = true; } + +void SMDirectionSelect::iconSetChange() +{ + IconManager &im = IconManager::instance(); + parentButton->setIcon(im.loadIcon("reset-style-changes")); +} Index: scribus/ui/smdirectionselect.h =================================================================== --- scribus/ui/smdirectionselect.h (Revision 26320) +++ scribus/ui/smdirectionselect.h (Arbeitskopie) @@ -23,11 +23,10 @@ bool m_useParentStyle = false; int m_pStyle = 0; - void setFont(bool wantBold); - private slots: void styleChanged(); void pbPressed(); + void iconSetChange(); }; #endif // SMDIRECTIONSELECT_H Index: scribus/ui/smpstylewidget.cpp =================================================================== --- scribus/ui/smpstylewidget.cpp (Revision 26320) +++ scribus/ui/smpstylewidget.cpp (Arbeitskopie) @@ -36,14 +36,14 @@ // optMarginCheckLeftProtruding->setVisible(false); iconSetChange(); - - backColor_->setPixmapType(ColorCombo::fancyPixmaps); - backColor_->clear(); - backColor_->addItem(CommonStrings::tr_NoneColor); - lineSpacingMode->addItem( tr("Fixed Linespacing")); - lineSpacingMode->addItem( tr("Automatic Linespacing")); - lineSpacingMode->addItem( tr("Align to Baseline Grid")); + backgroundColor->colorButton->setContext(Context::TextBackground); + backgroundColor->setColor(CommonStrings::tr_NoneColor); + backgroundColor->setText(tr("Background")); + + lineSpacingMode->addItem( tr("Fixed")); + lineSpacingMode->addItem( tr("Automatic")); + lineSpacingMode->addItem( tr("Baseline")); connect(lineSpacingMode, SIGNAL(highlighted(int)), this, SLOT(slotLineSpacingModeChanged(int))); lineSpacing->setSuffix(unitGetSuffixFromIndex(0)); @@ -65,6 +65,10 @@ numStartSpin->setMaximum(9999); numLevelSpin->setMinimum(1); numLevelSpin->setMaximum(1); + numPrefix->setMaxLength(5); + numPrefix->setMaximumWidth(QFontMetrics(numPrefix->font()).averageCharWidth() * 7); + numSuffix->setMaxLength(5); + numSuffix->setMaximumWidth(QFontMetrics(numSuffix->font()).averageCharWidth() * 7); fillNumRestartCombo(); dropCapLines->setMinimum(2); dropCapLines->setMaximum(99); @@ -75,7 +79,6 @@ connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); - connect(optMarginDefaultButton, SIGNAL(clicked()), this, SLOT(slotDefaultOpticalMargins())); if (m_Doc) connect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int))); m_enhanced = nullptr; @@ -100,15 +103,19 @@ { IconManager& iconManager = IconManager::instance(); - lineSpacingLabel->setPixmap(iconManager.loadPixmap("linespacing2.png")); - spaceAboveLabel->setPixmap(iconManager.loadPixmap("above.png") ); - spaceBelowLabel->setPixmap(iconManager.loadPixmap("below.png") ); - keepLabelStart->setPixmap(iconManager.loadPixmap("22/orphan.png") ); - keepLabelEnd->setPixmap(iconManager.loadPixmap("22/widow.png") ); - backIcon->setPixmap(iconManager.loadPixmap("16/color-fill.png")); - backShadeLabel->setPixmap(iconManager.loadPixmap("shade.png")); + lineSpacingLabel->setPixmap(iconManager.loadPixmap("paragraph-line-height")); + spaceAboveLabel->setPixmap(iconManager.loadPixmap("paragraph-space-above") ); + spaceBelowLabel->setPixmap(iconManager.loadPixmap("paragraph-space-below") ); + keepLabelStart->setPixmap(iconManager.loadPixmap("paragraph-orphan") ); + keepLabelEnd->setPixmap(iconManager.loadPixmap("paragraph-widow") ); + minSpaceLabel->setPixmap(iconManager.loadPixmap("character-space-width-min")); + minGlyphExtLabel->setPixmap(iconManager.loadPixmap("character-scale-width-min")); + maxGlyphExtLabel->setPixmap(iconManager.loadPixmap("character-scale-width-max")); + consecutiveHyphenLabel->setPixmap(iconManager.loadPixmap("hyphen-consecutive")); bulletCharTableButton->setIcon(IconManager::instance().loadPixmap("22/insert-table.png")); + distFromTextLabel->setPixmap(iconManager.loadPixmap("paragraph-list-offset")); + parEffectCharStyleComboLabel->setPixmap(iconManager.loadPixmap("character-style")); } void SMPStyleWidget::languageChange() @@ -122,9 +129,9 @@ int oldLineSpacingModeIndex = lineSpacingMode->currentIndex(); bool lineSpacingModeBlocked = lineSpacingMode->blockSignals(true); lineSpacingMode->clear(); - lineSpacingMode->addItem( tr("Fixed Linespacing")); - lineSpacingMode->addItem( tr("Automatic Linespacing")); - lineSpacingMode->addItem( tr("Align to Baseline Grid")); + lineSpacingMode->addItem( tr("Fixed")); + lineSpacingMode->addItem( tr("Automatic")); + lineSpacingMode->addItem( tr("Baseline")); lineSpacingMode->setCurrentIndex(oldLineSpacingModeIndex); lineSpacingMode->blockSignals(lineSpacingModeBlocked); @@ -151,12 +158,8 @@ (bulletStrEdit->lineEdit())->setFont(font1); */ - if (backColor_->count() > 0) - { - bool sigBlocked = backColor_->blockSignals(true); - backColor_->setItemText(0, CommonStrings::tr_NoneColor); - backColor_->blockSignals(sigBlocked); - } + backgroundColor->colorButton->setPersistentToolTip( tr("Background color of selected text")); + backgroundColor->setText(tr("Background")); } void SMPStyleWidget::unitChange(double oldRatio, double newRatio, int unitIndex) @@ -174,19 +177,13 @@ if (m_Doc) { connect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int))); - fillColorCombo(m_Doc->PageColors); fillNumerationsCombo(); } cpage->setDoc(m_Doc); + backgroundColor->colorButton->setDoc(m_Doc); } -void SMPStyleWidget::fillColorCombo(ColorList &colors) -{ - backColor_->clear(); - backColor_->setColors(colors, true); -} - void SMPStyleWidget::fillBulletStrEditCombo() { bulletStrEdit->clear(); @@ -241,9 +238,9 @@ m_hasParent = pstyle->hasParent() && parent != nullptr && parent->hasName() && pstyle->parent() != ""; lineSpacingMode->clear(); - lineSpacingMode->addItem( tr("Fixed Linespacing")); - lineSpacingMode->addItem( tr("Automatic Linespacing")); - lineSpacingMode->addItem( tr("Align to Baseline Grid")); + lineSpacingMode->addItem( tr("Fixed")); + lineSpacingMode->addItem( tr("Automatic")); + lineSpacingMode->addItem( tr("Baseline")); // optMarginCombo->clear(); // optMarginCombo->addItem(tr("None"), ParagraphStyle::OM_None); @@ -271,8 +268,7 @@ // optMarginCombo->setCurrentItemByData( pstyle->opticalMargins(), pstyle->isInhOpticalMargins() ); // optMarginCombo->setParentItem(optMarginCombo->getItemIndexForData( parent->opticalMargins())); - setOpticalMargins(pstyle->opticalMargins(), pstyle->isInhOpticalMargins(), parent); - connect(optMarginParentButton, SIGNAL(clicked()), this, SLOT(slotParentOpticalMargins())); + optMarginWidget->setOpticalMargins(pstyle->opticalMargins(), parent->opticalMargins(), pstyle->isInhOpticalMargins()); minSpaceSpin->setValue(pstyle->minWordTracking() * 100.0, pstyle->isInhMinWordTracking()); minSpaceSpin->setParentValue(parent->minWordTracking()); @@ -392,11 +388,7 @@ numRestartOtherBox->setParentValue(parent->numOther()); numRestartHigherBox->setChecked(pstyle->numHigher(), pstyle->isInhNumHigher()); numRestartHigherBox->setParentValue(parent->numHigher()); - - backColor_->setCurrentText(pstyle->backgroundColor(), pstyle->isInhBackgroundColor()); - backColor_->setParentText(parent->backgroundColor()); - backShade_->setValue(qRound(pstyle->backgroundShade()), pstyle->isInhBackgroundShade()); - backShade_->setParentValue(qRound(parent->backgroundShade())); + backgroundColor->setColor(pstyle->backgroundColor(), qRound(pstyle->backgroundShade()), parent->backgroundColor(), qRound(pstyle->backgroundShade()), pstyle->isInhBackgroundColor()); } else { @@ -405,8 +397,7 @@ spaceAbove->setValue(pstyle->gapBefore()); spaceBelow->setValue(pstyle->gapAfter()); // optMarginCombo->setCurrentItemByData( pstyle->opticalMargins() ); - setOpticalMargins(pstyle->opticalMargins()); - optMarginParentButton->hide(); + optMarginWidget->setOpticalMargins(pstyle->opticalMargins()); minSpaceSpin->setValue(pstyle->minWordTracking() * 100.0); minGlyphExtSpin->setValue(pstyle->minGlyphExtension() * 100.0); maxGlyphExtSpin->setValue(pstyle->maxGlyphExtension() * 100.0); @@ -458,8 +449,8 @@ keepLinesEnd->setValue (pstyle->keepLinesEnd()); keepTogether->setChecked (pstyle->keepTogether()); keepWithNext->setChecked (pstyle->keepWithNext()); - backColor_->setCurrentText(pstyle->backgroundColor()); - backShade_->setValue(qRound(pstyle->backgroundShade())); + backgroundColor->setColor(pstyle->backgroundColor(), qRound(pstyle->backgroundShade())); + } lineSpacing->setEnabled(pstyle->lineSpacingMode() == ParagraphStyle::FixedLineSpacing); @@ -543,13 +534,13 @@ } d = cstyles[i]->backgroundShade(); } - if (d == -30000) - { - backShade_->setValue(21); - backShade_->setText( tr("Shade")); - } - else - backShade_->setValue(qRound(d)); + // if (d == -30000) + // { + // backShade_->setValue(21); + // backShade_->setText( tr("Shade")); + // } + // else + // backShade_->setValue(qRound(d)); QString s; for (int i = 0; i < cstyles.count(); ++i) @@ -561,22 +552,25 @@ } s = cstyles[i]->backgroundColor(); } - if (s.isEmpty()) - { - if (backColor_->itemText(backColor_->count() - 1) != "") - backColor_->addItem(""); - backColor_->setCurrentIndex(backColor_->count() - 1); - } - else - backColor_->setCurrentText(s); + // if (s.isEmpty()) + // { + // if (backColor_->itemText(backColor_->count() - 1) != "") + // backColor_->addItem(""); + // backColor_->setCurrentIndex(backColor_->count() - 1); + // } + // else + // backColor_->setCurrentText(s); + + + backgroundColor->setColor(s, qRound(d)); } void SMPStyleWidget::showLineSpacing(const QList<ParagraphStyle*> &pstyles) { lineSpacingMode->clear(); - lineSpacingMode->addItem( tr("Fixed Linespacing")); - lineSpacingMode->addItem( tr("Automatic Linespacing")); - lineSpacingMode->addItem( tr("Align to Baseline Grid")); + lineSpacingMode->addItem( tr("Fixed")); + lineSpacingMode->addItem( tr("Automatic")); + lineSpacingMode->addItem( tr("Baseline")); int tmpLP = -1; for (int i = 0; i < pstyles.count(); ++i) @@ -823,7 +817,7 @@ // } // } // optMarginCombo->setCurrentItemByData(o); - setOpticalMargins(pstyles[0]->opticalMargins()); + optMarginWidget->setOpticalMargins(pstyles[0]->opticalMargins()); } void SMPStyleWidget::showMinSpace(const QList< ParagraphStyle * > & pstyles) @@ -1019,61 +1013,7 @@ // parentCombo->setCurrentItem(0); } -void SMPStyleWidget::setOpticalMargins(int o, bool inhO, const ParagraphStyle *parent) -{ - ParagraphStyle::OpticalMarginType om( static_cast<ParagraphStyle::OpticalMarginType>(o) ); - if (parent == nullptr) - { - if (om == ParagraphStyle::OM_Default) - optMarginRadioBoth->setChecked(true); - else if (om == ParagraphStyle::OM_LeftHangingPunct) - optMarginRadioLeft->setChecked(true); - else if (om == ParagraphStyle::OM_RightHangingPunct) - optMarginRadioRight->setChecked(true); - else - optMarginRadioNone->setChecked(true); - } - else - { - optMarginParentButton->setVisible(!inhO); - - if (om == ParagraphStyle::OM_Default) - optMarginRadioBoth->setChecked(true, - (parent->opticalMargins() == ParagraphStyle::OM_Default)); - else if (om == ParagraphStyle::OM_LeftHangingPunct) - optMarginRadioLeft->setChecked(true, - (parent->opticalMargins() == ParagraphStyle::OM_LeftHangingPunct)); - else if (om == ParagraphStyle::OM_RightHangingPunct) - optMarginRadioRight->setChecked(true, - (parent->opticalMargins() == ParagraphStyle::OM_RightHangingPunct)); - else - optMarginRadioNone->setChecked(true, - (parent->opticalMargins() == ParagraphStyle::OM_None)); - - optMarginRadioBoth->setParentValue(parent->opticalMargins() == ParagraphStyle::OM_Default); - optMarginRadioLeft->setParentValue(parent->opticalMargins() == ParagraphStyle::OM_LeftHangingPunct); - optMarginRadioRight->setParentValue(parent->opticalMargins() == ParagraphStyle::OM_RightHangingPunct); - optMarginRadioNone->setParentValue(parent->opticalMargins() == ParagraphStyle::OM_None); - } -} - - -void SMPStyleWidget::slotDefaultOpticalMargins() -{ - optMarginRadioNone->setChecked(true); - if (m_hasParent) - optMarginParentButton->show(); -} - -void SMPStyleWidget::slotParentOpticalMargins() -{ - disconnect(optMarginParentButton, SIGNAL(clicked()), this, SLOT(slotParentOpticalMargins())); - optMarginParentButton->hide(); - emit useParentOptMargins(); - connect(optMarginParentButton, SIGNAL(clicked()), this, SLOT(slotParentOpticalMargins())); -} - void SMPStyleWidget::clearAll() { @@ -1248,8 +1188,6 @@ { if (!m_Doc) return; - if (updateFlags & reqColorsUpdate) - fillColorCombo(m_Doc->PageColors); if (updateFlags & reqNumUpdate) fillNumerationsCombo(); } Index: scribus/ui/smpstylewidget.h =================================================================== --- scribus/ui/smpstylewidget.h (Revision 26320) +++ scribus/ui/smpstylewidget.h (Arbeitskopie) @@ -48,7 +48,6 @@ ParagraphStyle* m_currPStyle = nullptr; StyleSet<CharStyle> *m_cstyles = nullptr; - void fillColorCombo(ColorList &colors); void fillBulletStrEditCombo(); void fillNumerationsCombo(); void fillNumRestartCombo(); @@ -69,7 +68,6 @@ void showTabs(const QList<ParagraphStyle*> &pstyles, int unitIndex); void showCStyle(const QList<ParagraphStyle*> &pstyles, const QList<CharStyle> &cstyles, const QString &defLang, int unitIndex); void showParent(const QList<ParagraphStyle*> &pstyles); - void setOpticalMargins(int o, bool inhO = false, const ParagraphStyle* parent = nullptr); void openEnhanced(); void closeEnhanced(bool show = false); @@ -86,15 +84,11 @@ void insertSpecialChars(const QVector<uint> &charCodes); void slotNumbering(bool isOn); void slotParentParEffects(); - void slotDefaultOpticalMargins(); - void slotParentOpticalMargins(); -// void slotUpdateOpticalMarginsFromCheckBoxes(int); void on_bulletCharTableButton_toggled(bool checked); void handleUpdateRequest(int); signals: void useParentParaEffects(); - void useParentOptMargins(); }; #endif Index: scribus/ui/smstyleselect.cpp =================================================================== --- scribus/ui/smstyleselect.cpp (Revision 26320) +++ scribus/ui/smstyleselect.cpp (Arbeitskopie) @@ -6,18 +6,23 @@ */ #include "smstyleselect.h" +#include "iconmanager.h" +#include "scribusapp.h" SMStyleSelect::SMStyleSelect(QWidget *parent) : StyleSelect(parent) { parentButton = new QToolButton(this); - parentButton->setMaximumSize(QSize(22, 22)); - parentButton->setMinimumSize(QSize(22, 22)); - parentButton->setText( tr("P", "P as in Parent")); + parentButton->setText( ""); parentButton->setToolTip( tr("Use parent style's effects instead of overriding them")); + ssLayout->addSpacerItem(new QSpacerItem(8, 0, QSizePolicy::Fixed)); ssLayout->addWidget(parentButton); resize(minimumSizeHint()); parentButton->hide(); + + iconSetChange(); + + connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); } void SMStyleSelect::setStyle(int i) @@ -114,3 +119,9 @@ m_useParentStyle = true; emit State(getStyle()); } + +void SMStyleSelect::iconSetChange() +{ + IconManager &im = IconManager::instance(); + parentButton->setIcon(im.loadIcon("reset-style-changes")); +} Index: scribus/ui/smstyleselect.h =================================================================== --- scribus/ui/smstyleselect.h (Revision 26320) +++ scribus/ui/smstyleselect.h (Arbeitskopie) @@ -31,6 +31,9 @@ void setFont(bool wantBold); +public slots: + void iconSetChange(); + private slots: void styleChanged(); void pbPressed(); Index: scribus/ui/smtabruler.cpp =================================================================== --- scribus/ui/smtabruler.cpp (Revision 26320) +++ scribus/ui/smtabruler.cpp (Arbeitskopie) @@ -31,20 +31,23 @@ rightIndentSpin = new SMScrSpinBox(0, 4000, this, dEin); Q_CHECK_PTR(rightIndentSpin); - indentLayout->removeWidget(firstLineData); +// indentLayout->rightIndentLabel->removeWidget(firstLineData); firstLineData->hide(); - indentLayout->insertWidget(1, firstLineSpin); - firstLineSpin->show(); + firstLineLabel->addWidget(firstLineSpin); + // indentLayout->insertWidget(1, firstLineSpin); + // firstLineSpin->show(); - indentLayout->removeWidget(leftIndentData); +// indentLayout->removeWidget(leftIndentData); leftIndentData->hide(); - indentLayout->insertWidget(3, leftIndentSpin); - leftIndentSpin->show(); + leftIndentLabel->addWidget(leftIndentSpin); +// indentLayout->insertWidget(3, leftIndentSpin); +// leftIndentSpin->show(); - indentLayout->removeWidget(rightIndentData); +// indentLayout->removeWidget(rightIndentData); rightIndentData->hide(); - indentLayout->insertWidget(5, rightIndentSpin); - rightIndentSpin->show(); + rightIndentLabel->addWidget(rightIndentSpin); +// indentLayout->insertWidget(5, rightIndentSpin); +// rightIndentSpin->show(); connect(firstLineData, SIGNAL(valueChanged(double)), this, SLOT(firstDataChanged())); connect(rightIndentData, SIGNAL(valueChanged(double)), this, SLOT(rightDataChanged())); Index: scribus/ui/smtextstyles.cpp =================================================================== --- scribus/ui/smtextstyles.cpp (Revision 26320) +++ scribus/ui/smtextstyles.cpp (Arbeitskopie) @@ -498,11 +498,7 @@ connect(m_pwidget->direction->LTR, SIGNAL(clicked()), this, SLOT(slotDirection())); connect(m_pwidget->direction->parentButton, SIGNAL(clicked()), this, SLOT(slotDirection())); // connect(m_pwidget->optMarginCombo, SIGNAL(activated(int)), this, SLOT(slotOpticalMargin(int))); - connect(m_pwidget->optMarginRadioNone, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector())); - connect(m_pwidget->optMarginRadioLeft, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector())); - connect(m_pwidget->optMarginRadioRight, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector())); - connect(m_pwidget->optMarginRadioBoth, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector())); - connect(m_pwidget, SIGNAL(useParentOptMargins()), this, SLOT(slotParentOpticalMargin())); + connect(m_pwidget->optMarginWidget, SIGNAL(opticalMarginChanged()), this, SLOT(slotOpticalMarginSelector())); connect(m_pwidget->minSpaceSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinSpace())); connect(m_pwidget->minGlyphExtSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinGlyphExt())); @@ -544,8 +540,8 @@ connect(m_pwidget->tabList->firstLineSpin, SIGNAL(valueChanged(double)), this, SLOT(slotFirstLine())); connect(m_pwidget->parentCombo, SIGNAL(currentTextChanged(QString)), this, SLOT(slotParentChanged(QString))); - connect(m_pwidget->backColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotBackPColor())); - connect(m_pwidget->backShade_, SIGNAL(clicked()), this, SLOT(slotBackPShade())); + connect(m_pwidget->backgroundColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotBackPColor())); + connect(m_pwidget->backgroundColor->parentButton, SIGNAL(clicked()), this, SLOT(slotBackPColor())); // character attributes connect(m_pwidget->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString))); @@ -557,10 +553,10 @@ connect(m_pwidget->cpage->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); connect(m_pwidget->cpage->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); connect(m_pwidget->cpage->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); - connect(m_pwidget->cpage->fillColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotFillColor())); - connect(m_pwidget->cpage->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade())); - connect(m_pwidget->cpage->strokeColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotStrokeColor())); - connect(m_pwidget->cpage->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade())); + // connect(m_pwidget->cpage->fillColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotFillColor())); + // connect(m_pwidget->cpage->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade())); + // connect(m_pwidget->cpage->strokeColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotStrokeColor())); + // connect(m_pwidget->cpage->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade())); connect(m_pwidget->cpage->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage())); connect(m_pwidget->cpage->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize())); connect(m_pwidget->cpage->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH())); @@ -569,8 +565,16 @@ connect(m_pwidget->cpage->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking())); connect(m_pwidget->cpage->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset())); connect(m_pwidget->cpage->parentCombo, SIGNAL(currentTextChanged(QString)), this, SLOT(slotCharParentChanged(QString))); - connect(m_pwidget->cpage->backColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotBackColor())); - connect(m_pwidget->cpage->backShade_, SIGNAL(clicked()), this, SLOT(slotBackShade())); + // connect(m_pwidget->cpage->backColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotBackColor())); + // connect(m_pwidget->cpage->backShade_, SIGNAL(clicked()), this, SLOT(slotBackShade())); + + connect(m_pwidget->cpage->textColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotFillColor())); + connect(m_pwidget->cpage->textColor->parentButton, SIGNAL(clicked()), this, SLOT(slotFillColor())); + connect(m_pwidget->cpage->backgroundColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotBackColor())); + connect(m_pwidget->cpage->backgroundColor->parentButton, SIGNAL(clicked()), this, SLOT(slotBackColor())); + connect(m_pwidget->cpage->strokeColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotStrokeColor())); + connect(m_pwidget->cpage->strokeColor->parentButton, SIGNAL(clicked()), this, SLOT(slotStrokeColor())); + connect(m_pwidget->cpage->fontfeaturesSetting,SIGNAL(changed()), this, SLOT(slotFontFeatures())); connect(m_pwidget->cpage->hyphenCharLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotHyphenChar())); connect(m_pwidget->cpage->smallestWordSpinBox, SIGNAL(valueChanged(int)), this, SLOT(slotWordMin())); @@ -598,10 +602,7 @@ disconnect(m_pwidget->direction->LTR, SIGNAL(clicked()), this, SLOT(slotDirection())); disconnect(m_pwidget->direction->parentButton, SIGNAL(clicked()), this, SLOT(slotDirection())); // disconnect(m_pwidget->optMarginCombo, SIGNAL(activated(int)), this, SLOT(slotOpticalMargin(int))); - disconnect(m_pwidget->optMarginRadioNone, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector())); - disconnect(m_pwidget->optMarginRadioLeft, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector())); - disconnect(m_pwidget->optMarginRadioRight, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector())); - disconnect(m_pwidget->optMarginRadioBoth, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector())); + disconnect(m_pwidget->optMarginWidget, SIGNAL(opticalMarginChanged()), this, SLOT(slotOpticalMarginSelector())); disconnect(m_pwidget->minSpaceSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinSpace())); disconnect(m_pwidget->minGlyphExtSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinGlyphExt())); @@ -642,8 +643,8 @@ disconnect(m_pwidget->tabList->leftIndentSpin, SIGNAL(valueChanged(double)), this, SLOT(slotLeftIndent())); disconnect(m_pwidget->tabList->rightIndentSpin, SIGNAL(valueChanged(double)), this, SLOT(slotRightIndent())); disconnect(m_pwidget->tabList->firstLineSpin, SIGNAL(valueChanged(double)), this, SLOT(slotFirstLine())); - disconnect(m_pwidget->backColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotBackPColor())); - disconnect(m_pwidget->backShade_, SIGNAL(clicked()), this, SLOT(slotBackPShade())); + disconnect(m_pwidget->backgroundColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotBackPColor())); + disconnect(m_pwidget->backgroundColor->parentButton, SIGNAL(clicked()), this, SLOT(slotBackPColor())); disconnect(m_pwidget->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString))); disconnect(m_pwidget->cpage->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int))); @@ -654,10 +655,10 @@ disconnect(m_pwidget->cpage->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); disconnect(m_pwidget->cpage->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); disconnect(m_pwidget->cpage->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); - disconnect(m_pwidget->cpage->fillColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotFillColor())); - disconnect(m_pwidget->cpage->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade())); - disconnect(m_pwidget->cpage->strokeColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotStrokeColor())); - disconnect(m_pwidget->cpage->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade())); + // disconnect(m_pwidget->cpage->fillColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotFillColor())); + // disconnect(m_pwidget->cpage->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade())); + // disconnect(m_pwidget->cpage->strokeColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotStrokeColor())); + // disconnect(m_pwidget->cpage->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade())); disconnect(m_pwidget->cpage->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage())); disconnect(m_pwidget->cpage->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize())); disconnect(m_pwidget->cpage->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH())); @@ -666,8 +667,16 @@ disconnect(m_pwidget->cpage->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking())); disconnect(m_pwidget->cpage->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset())); disconnect(m_pwidget->cpage->parentCombo, SIGNAL(currentTextChanged(QString)), this, SLOT(slotCharParentChanged(QString))); - disconnect(m_pwidget->cpage->backColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotBackColor())); - disconnect(m_pwidget->cpage->backShade_, SIGNAL(clicked()), this, SLOT(slotBackShade())); + // disconnect(m_pwidget->cpage->backColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotBackColor())); + // disconnect(m_pwidget->cpage->backShade_, SIGNAL(clicked()), this, SLOT(slotBackShade())); + + disconnect(m_pwidget->cpage->textColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotFillColor())); + disconnect(m_pwidget->cpage->textColor->parentButton, SIGNAL(clicked()), this, SLOT(slotFillColor())); + disconnect(m_pwidget->cpage->backgroundColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotBackColor())); + disconnect(m_pwidget->cpage->backgroundColor->parentButton, SIGNAL(clicked()), this, SLOT(slotBackColor())); + disconnect(m_pwidget->cpage->strokeColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotStrokeColor())); + disconnect(m_pwidget->cpage->strokeColor->parentButton, SIGNAL(clicked()), this, SLOT(slotStrokeColor())); + disconnect(m_pwidget->cpage->fontfeaturesSetting, SIGNAL(changed()), this, SLOT(slotFontFeatures())); disconnect(m_pwidget->cpage->hyphenCharLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotHyphenChar())); disconnect(m_pwidget->cpage->smallestWordSpinBox, SIGNAL(valueChanged(int)), this, SLOT(slotWordMin())); @@ -784,16 +793,16 @@ void SMParagraphStyle::slotOpticalMarginSelector() { - int omt(ParagraphStyle::OM_None); + ParagraphStyle::OpticalMarginType omt( static_cast<ParagraphStyle::OpticalMarginType>(m_pwidget->optMarginWidget->opticalMargin())); + if (m_pwidget->optMarginWidget->useParentValue()) + for (int i = 0; i < m_selection.count(); ++i) + m_selection[i]->resetOpticalMargins(); + else + for (int i = 0; i < m_selection.count(); ++i) + m_selection[i]->setOpticalMargins(omt); - if (m_pwidget->optMarginRadioRight->isChecked()) omt = ParagraphStyle::OM_RightHangingPunct; - else if (m_pwidget->optMarginRadioLeft->isChecked()) omt = ParagraphStyle::OM_LeftHangingPunct; - else if (m_pwidget->optMarginRadioBoth->isChecked()) omt = ParagraphStyle::OM_Default; + slotSelectionDirty(); - for (int i = 0; i < m_selection.count(); ++i) - m_selection[i]->setOpticalMargins(omt); - - slotSelectionDirty(); } void SMParagraphStyle::slotParentOpticalMargin() @@ -1424,35 +1433,25 @@ void SMParagraphStyle::slotFillColor() { - if (m_pwidget->cpage->fillColor_->useParentValue()) + if (m_pwidget->cpage->textColor->useParentValue()) { for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->charStyle().resetFillColor(); + m_selection[i]->charStyle().resetFillShade(); + } } else { - QString col( m_pwidget->cpage->fillColor_->currentText()); + QString col( m_pwidget->cpage->textColor->colorButton->colorName()); if (col == CommonStrings::tr_NoneColor) col = CommonStrings::None; + int fs = m_pwidget->cpage->textColor->colorButton->colorData().Shade; for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->charStyle().setFillColor(col); - } - - slotSelectionDirty(); -} - -void SMParagraphStyle::slotFillShade() -{ - if (m_pwidget->cpage->fillShade_->useParentValue()) - { - for (int i = 0; i < m_selection.count(); ++i) - m_selection[i]->charStyle().resetFillShade(); - } - else - { - int fs = m_pwidget->cpage->fillShade_->getValue(); - for (int i = 0; i < m_selection.count(); ++i) m_selection[i]->charStyle().setFillShade(fs); + } } slotSelectionDirty(); @@ -1460,35 +1459,25 @@ void SMParagraphStyle::slotBackPColor() { - if (m_pwidget->backColor_->useParentValue()) + if (m_pwidget->backgroundColor->useParentValue()) { for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->resetBackgroundColor(); + m_selection[i]->resetBackgroundShade(); + } } else { - QString col( m_pwidget->backColor_->currentText()); + QString col( m_pwidget->backgroundColor->colorButton->colorName()); if (col == CommonStrings::tr_NoneColor) col = CommonStrings::None; + int fs = m_pwidget->backgroundColor->colorButton->colorData().Shade; for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->setBackgroundColor(col); - } - - slotSelectionDirty(); -} - -void SMParagraphStyle::slotBackPShade() -{ - if (m_pwidget->backShade_->useParentValue()) - { - for (int i = 0; i < m_selection.count(); ++i) - m_selection[i]->resetBackgroundShade(); - } - else - { - int fs = m_pwidget->backShade_->getValue(); - for (int i = 0; i < m_selection.count(); ++i) m_selection[i]->setBackgroundShade(fs); + } } slotSelectionDirty(); @@ -1496,35 +1485,25 @@ void SMParagraphStyle::slotBackColor() { - if (m_pwidget->cpage->backColor_->useParentValue()) + if (m_pwidget->cpage->backgroundColor->useParentValue()) { for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->charStyle().resetBackColor(); + m_selection[i]->charStyle().resetBackShade(); + } } else { - QString col( m_pwidget->cpage->backColor_->currentText()); + QString col( m_pwidget->cpage->backgroundColor->colorButton->colorName()); if (col == CommonStrings::tr_NoneColor) col = CommonStrings::None; + int fs = m_pwidget->cpage->backgroundColor->colorButton->colorData().Shade; for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->charStyle().setBackColor(col); - } - - slotSelectionDirty(); -} - -void SMParagraphStyle::slotBackShade() -{ - if (m_pwidget->cpage->backShade_->useParentValue()) - { - for (int i = 0; i < m_selection.count(); ++i) - m_selection[i]->charStyle().resetBackShade(); - } - else - { - int fs = m_pwidget->cpage->backShade_->getValue(); - for (int i = 0; i < m_selection.count(); ++i) m_selection[i]->charStyle().setBackShade(fs); + } } slotSelectionDirty(); @@ -1532,37 +1511,27 @@ void SMParagraphStyle::slotStrokeColor() { - if (m_pwidget->cpage->strokeColor_->useParentValue()) + if (m_pwidget->cpage->strokeColor->useParentValue()) { for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->charStyle().resetStrokeColor(); + m_selection[i]->charStyle().resetStrokeShade(); + } } else { - QString col(m_pwidget->cpage->strokeColor_->currentText()); + QString col( m_pwidget->cpage->strokeColor->colorButton->colorName()); if (col == CommonStrings::tr_NoneColor) col = CommonStrings::None; + int fs = m_pwidget->cpage->strokeColor->colorButton->colorData().Shade; for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->charStyle().setStrokeColor(col); + m_selection[i]->charStyle().setStrokeShade(fs); + } } - - slotSelectionDirty(); -} -void SMParagraphStyle::slotStrokeShade() -{ - if (m_pwidget->cpage->strokeShade_->useParentValue()) - { - for (int i = 0; i < m_selection.count(); ++i) - m_selection[i]->charStyle().resetStrokeShade(); - } - else - { - int ss = m_pwidget->cpage->strokeShade_->getValue(); - for (int i = 0; i < m_selection.count(); ++i) - m_selection[i]->charStyle().setStrokeShade(ss); - } - slotSelectionDirty(); } @@ -2282,10 +2251,7 @@ connect(m_page->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); connect(m_page->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); connect(m_page->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); - connect(m_page->fillColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotFillColor())); - connect(m_page->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade())); - connect(m_page->strokeColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotStrokeColor())); - connect(m_page->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade())); + connect(m_page->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage())); connect(m_page->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize())); connect(m_page->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH())); @@ -2294,8 +2260,14 @@ connect(m_page->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking())); connect(m_page->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset())); connect(m_page->parentCombo, SIGNAL(currentTextChanged(QString)), this, SLOT(slotParentChanged(QString))); - connect(m_page->backColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotBackColor())); - connect(m_page->backShade_, SIGNAL(clicked()), this, SLOT(slotBackShade())); + + connect(m_page->textColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotFillColor())); + connect(m_page->textColor->parentButton, SIGNAL(clicked()), this, SLOT(slotFillColor())); + connect(m_page->backgroundColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotBackColor())); + connect(m_page->backgroundColor->parentButton, SIGNAL(clicked()), this, SLOT(slotBackColor())); + connect(m_page->strokeColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotStrokeColor())); + connect(m_page->strokeColor->parentButton, SIGNAL(clicked()), this, SLOT(slotStrokeColor())); + connect(m_page->fontfeaturesSetting, SIGNAL(changed()), this, SLOT(slotFontFeatures())); connect(m_page->smallestWordSpinBox, SIGNAL(valueChanged(int)), this, SLOT(slotSmallestWord())); connect(m_page->hyphenCharLineEdit, SIGNAL(textChanged(QString)),this, SLOT(slotHyphenChar())); @@ -2315,10 +2287,7 @@ disconnect(m_page->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); disconnect(m_page->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); disconnect(m_page->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties())); - disconnect(m_page->fillColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotFillColor())); - disconnect(m_page->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade())); - disconnect(m_page->strokeColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotStrokeColor())); - disconnect(m_page->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade())); + disconnect(m_page->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage())); disconnect(m_page->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize())); disconnect(m_page->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH())); @@ -2327,8 +2296,14 @@ disconnect(m_page->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking())); disconnect(m_page->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset())); disconnect(m_page->parentCombo, SIGNAL(currentTextChanged(QString)), this, SLOT(slotParentChanged(QString))); - disconnect(m_page->backColor_, SIGNAL(currentTextChanged(QString)), this, SLOT(slotBackColor())); - disconnect(m_page->backShade_, SIGNAL(clicked()), this, SLOT(slotBackShade())); + + disconnect(m_page->textColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotFillColor())); + disconnect(m_page->textColor->parentButton, SIGNAL(clicked()), this, SLOT(slotFillColor())); + disconnect(m_page->backgroundColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotBackColor())); + disconnect(m_page->backgroundColor->parentButton, SIGNAL(clicked()), this, SLOT(slotBackColor())); + disconnect(m_page->strokeColor->colorButton, SIGNAL(colorChanged()), this, SLOT(slotStrokeColor())); + disconnect(m_page->strokeColor->parentButton, SIGNAL(clicked()), this, SLOT(slotStrokeColor())); + disconnect(m_page->fontfeaturesSetting, SIGNAL(changed()), this, SLOT(slotFontFeatures())); disconnect(m_page->smallestWordSpinBox, SIGNAL(valueChanged(int)), this, SLOT(slotSmallestWord())); disconnect(m_page->hyphenCharLineEdit, SIGNAL(textChanged(QString)),this, SLOT(slotHyphenChar())); @@ -2452,30 +2427,22 @@ void SMCharacterStyle::slotFillColor() { - if (m_page->fillColor_->useParentValue()) + if (m_page->textColor->useParentValue()) for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->resetFillColor(); + m_selection[i]->resetFillShade(); + } else { - QString col(m_page->fillColor_->currentText()); + QString col(m_page->textColor->colorButton->colorName()); if (col == CommonStrings::tr_NoneColor) col = CommonStrings::None; + int fs = m_page->textColor->colorButton->colorData().Shade; for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->setFillColor(col); - } - - slotSelectionDirty(); -} - -void SMCharacterStyle::slotFillShade() -{ - if (m_page->fillShade_->useParentValue()) - for (int i = 0; i < m_selection.count(); ++i) - m_selection[i]->resetFillShade(); - else { - int fs = m_page->fillShade_->getValue(); - - for (int i = 0; i < m_selection.count(); ++i) m_selection[i]->setFillShade(fs); + } } slotSelectionDirty(); @@ -2482,31 +2449,23 @@ } void SMCharacterStyle::slotBackColor() -{ - if (m_page->backColor_->useParentValue()) +{ + if (m_page->backgroundColor->useParentValue()) for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->resetBackColor(); + m_selection[i]->resetBackShade(); + } else { - QString col(m_page->backColor_->currentText()); + QString col(m_page->backgroundColor->colorButton->colorName()); if (col == CommonStrings::tr_NoneColor) col = CommonStrings::None; + int fs = m_page->backgroundColor->colorButton->colorData().Shade; for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->setBackColor(col); - } - - slotSelectionDirty(); -} - -void SMCharacterStyle::slotBackShade() -{ - if (m_page->backShade_->useParentValue()) - for (int i = 0; i < m_selection.count(); ++i) - m_selection[i]->resetBackShade(); - else { - int fs = m_page->backShade_->getValue(); - - for (int i = 0; i < m_selection.count(); ++i) m_selection[i]->setBackShade(fs); + } } slotSelectionDirty(); @@ -2514,35 +2473,27 @@ void SMCharacterStyle::slotStrokeColor() { - if (m_page->strokeColor_->useParentValue()) + if (m_page->strokeColor->useParentValue()) for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->resetStrokeColor(); + m_selection[i]->resetStrokeShade(); + } else { - QString col(m_page->strokeColor_->currentText()); + QString col(m_page->strokeColor->colorButton->colorName()); if (col == CommonStrings::tr_NoneColor) col = CommonStrings::None; + int fs = m_page->strokeColor->colorButton->colorData().Shade; for (int i = 0; i < m_selection.count(); ++i) + { m_selection[i]->setStrokeColor(col); + m_selection[i]->setStrokeShade(fs); + } } slotSelectionDirty(); } -void SMCharacterStyle::slotStrokeShade() -{ - if (m_page->strokeShade_->useParentValue()) - for (int i = 0; i < m_selection.count(); ++i) - m_selection[i]->resetStrokeShade(); - else { - int ss = m_page->strokeShade_->getValue(); - - for (int i = 0; i < m_selection.count(); ++i) - m_selection[i]->setStrokeShade(ss); - } - - slotSelectionDirty(); -} - void SMCharacterStyle::slotLanguage() { QString language = m_doc->paragraphStyle("").charStyle().language(); Index: scribus/ui/smtextstyles.h =================================================================== --- scribus/ui/smtextstyles.h (Revision 26320) +++ scribus/ui/smtextstyles.h (Arbeitskopie) @@ -113,17 +113,13 @@ void slotRightIndent(); void slotFirstLine(); void slotBackPColor(); - void slotBackPShade(); // cstyle void slotFontSize(); void slotEffects(int e); void slotEffectProperties(); void slotFillColor(); - void slotFillShade(); void slotStrokeColor(); - void slotStrokeShade(); void slotBackColor(); - void slotBackShade(); void slotLanguage(); void slotWordMin(); void slotHyphenChar(); @@ -192,11 +188,8 @@ void slotEffects(int e); void slotEffectProperties(); void slotFillColor(); - void slotFillShade(); void slotBackColor(); - void slotBackShade(); void slotStrokeColor(); - void slotStrokeShade(); void slotLanguage(); void slotScaleH(); void slotScaleV(); Index: scribus/ui/storyeditor.cpp =================================================================== --- scribus/ui/storyeditor.cpp (Revision 26320) +++ scribus/ui/storyeditor.cpp (Arbeitskopie) @@ -1289,7 +1289,7 @@ trackingLabel = new QLabel( this ); trackingLabel->setText(""); - trackingLabel->setPixmap(IconManager::instance().loadPixmap("textkern.png")); + trackingLabel->setPixmap(IconManager::instance().loadPixmap("character-letter-tracking")); trackingLabelAction = addWidget(trackingLabel); trackingLabelAction->setVisible(true); @@ -1327,7 +1327,7 @@ void SToolBStyle::iconSetChange() { IconManager& iconManager = IconManager::instance(); - trackingLabel->setPixmap(iconManager.loadPixmap("textkern.png")); + trackingLabel->setPixmap(iconManager.loadPixmap("character-letter-tracking")); } void SToolBStyle::languageChange() @@ -1482,7 +1482,7 @@ sizeAction->setVisible(true); lblScaleTxtH = new QLabel(this); - lblScaleTxtH->setPixmap(IconManager::instance().loadPixmap("textscaleh.png")); + lblScaleTxtH->setPixmap(IconManager::instance().loadPixmap("character-scale-height")); scaleTxtHAction = addWidget(lblScaleTxtH); scaleTxtHAction->setVisible(true); @@ -1494,7 +1494,7 @@ chScaleHAction->setVisible(true); lblScaleTxtV = new QLabel(this); - lblScaleTxtV->setPixmap(IconManager::instance().loadPixmap("textscalev.png")); + lblScaleTxtV->setPixmap(IconManager::instance().loadPixmap("character-scale-width")); scaleTxtVAction = addWidget(lblScaleTxtV); scaleTxtVAction->setVisible(true); @@ -1527,8 +1527,8 @@ void SToolBFont::iconSetChange() { IconManager& iconManager = IconManager::instance(); - lblScaleTxtH->setPixmap(iconManager.loadPixmap("textscaleh.png")); - lblScaleTxtV->setPixmap(iconManager.loadPixmap("textscalev.png")); + lblScaleTxtH->setPixmap(iconManager.loadPixmap("character-scale-height")); + lblScaleTxtV->setPixmap(iconManager.loadPixmap("character-scale-width")); } void SToolBFont::languageChange() Index: scribus/ui/stylemanager.cpp =================================================================== --- scribus/ui/stylemanager.cpp (Revision 26320) +++ scribus/ui/stylemanager.cpp (Arbeitskopie) @@ -201,6 +201,44 @@ okButton->setText(CommonStrings::tr_OK); } +void StyleManager::editStyleByName(int rcType, const QString &name) +{ + m_rcStyle = name; + int i = 0; + + // nitramr: + // We need a better way to find rcType than by ID of top level items. If the order of the root style changes it will break. + // It is better to store an unchangable identifier in StyleViewItem::data(int column, int role). + // https://doc.qt.io/qt-6/qtreewidgetitem.html#data + + QTreeWidgetItemIterator it(styleView); + while (*it) + { + StyleViewItem *item = dynamic_cast<StyleViewItem*>(*it); + if (item) + { + // find rcType by ID + if (item->isRoot()) + { + if (i == rcType) + m_rcType = item->text(0); + ++i; + } + + // double click item with matching style name in right root style + if (item->rootName() == m_rcType && item->text(0) == m_rcStyle) + { + slotDoubleClick(item, 0); + break; + } + + } + ++it; + } + m_rcStyle.clear(); + m_rcType.clear(); +} + void StyleManager::setDoc(ScribusDoc *doc) { ScribusDoc* oldDoc = m_doc; @@ -244,6 +282,58 @@ } } +void StyleManager::showAsNewParagraphStyle() +{ + setPaletteShown(true); + slotNewPopup(m_newPopup->actions().at(0)); +} + +void StyleManager::showAsNewCharacterStyle() +{ + setPaletteShown(true); + slotNewPopup(m_newPopup->actions().at(1)); +} + +void StyleManager::showAsNewLineStyle() +{ + setPaletteShown(true); + slotNewPopup(m_newPopup->actions().at(4)); +} + +void StyleManager::showAsEditCharacterStyle(const QString &name) +{ + if (name.isEmpty()) + return; + + setPaletteShown(true); + + // 1 = top level id of character style in viewStyles list + editStyleByName(1, name); +} + +void StyleManager::showAsEditLineStyle(const QString &name) +{ + if (name.isEmpty()) + return; + + setPaletteShown(true); + + // 4 = top level id of line style in viewStyles list + editStyleByName(4, name); +} + +void StyleManager::showAsEditParagraphStyle(const QString &name) +{ + if (name.isEmpty()) + return; + + setPaletteShown(true); + + // 0 = top level id of paragraph style in viewStyles list + editStyleByName(0, name); + +} + void StyleManager::addStyle(StyleItem *item) { m_items.append(item); Index: scribus/ui/stylemanager.h =================================================================== --- scribus/ui/stylemanager.h (Revision 26320) +++ scribus/ui/stylemanager.h (Arbeitskopie) @@ -31,6 +31,13 @@ void addStyle(StyleItem *item); void updateColorList(); + void showAsNewParagraphStyle(); + void showAsNewCharacterStyle(); + void showAsNewLineStyle(); + void showAsEditParagraphStyle(const QString& name); + void showAsEditCharacterStyle(const QString& name); + void showAsEditLineStyle(const QString& name); + QMap<QString,Keys> keyMap(); public slots: @@ -105,6 +112,8 @@ void setSelection(const QList<QPair<QString, QString> > &selected); void setOkButtonText(); + void editStyleByName(int rcType, const QString &name); + template<class ItemType> ItemType* item(); private slots: Index: scribus/ui/styleselect.cpp =================================================================== --- scribus/ui/styleselect.cpp (Revision 26320) +++ scribus/ui/styleselect.cpp (Arbeitskopie) @@ -14,8 +14,8 @@ StrikeValues::StrikeValues( QWidget* parent ) : QFrame( parent ) { group1Layout = new QGridLayout( this ); - group1Layout->setSpacing(3); - group1Layout->setContentsMargins(3, 3, 3, 3); + group1Layout->setSpacing(4); + group1Layout->setContentsMargins(8, 8, 8, 8); group1Layout->setAlignment( Qt::AlignTop ); LPos = new ScrSpinBox( -0.1, 100, this, 0 ); LPos->setValue( -0.1 ); @@ -47,8 +47,8 @@ UnderlineValues::UnderlineValues( QWidget* parent ) : QFrame( parent ) { group1Layout = new QGridLayout(this); - group1Layout->setSpacing(3); - group1Layout->setContentsMargins(3, 3, 3, 3); + group1Layout->setSpacing(4); + group1Layout->setContentsMargins(8, 8, 8, 8); group1Layout->setAlignment( Qt::AlignTop ); LPos = new ScrSpinBox( -0.1, 100, this, 0 ); LPos->setValue( -0.1 ); @@ -80,8 +80,8 @@ OutlineValues::OutlineValues( QWidget* parent ) : QFrame( parent ) { group1Layout = new QGridLayout( this ); - group1Layout->setSpacing(3); - group1Layout->setContentsMargins(3, 3, 3, 3); + group1Layout->setSpacing(4); + group1Layout->setContentsMargins(8, 8, 8, 8); group1Layout->setAlignment( Qt::AlignTop ); LWidth = new ScrSpinBox( 0, 100, this, 0 ); LWidth->setValue( 1 ); @@ -101,8 +101,8 @@ ShadowValues::ShadowValues( QWidget* parent ) : QFrame( parent ) { group1Layout = new QGridLayout( this ); - group1Layout->setSpacing(3); - group1Layout->setContentsMargins(3, 3, 3, 3); + group1Layout->setSpacing(4); + group1Layout->setContentsMargins(8, 8, 8, 8); group1Layout->setAlignment( Qt::AlignTop ); Xoffset = new ScrSpinBox( -100, 100, this, 0 ); Xoffset->setValue( 5 ); @@ -131,7 +131,7 @@ { IconManager& im = IconManager::instance(); ssLayout = new QHBoxLayout(this); - ssLayout->setSpacing(3); + ssLayout->setSpacing(4); ssLayout->setContentsMargins(0, 0, 0, 0); UnderlineVal = new UnderlineValues( nullptr ); @@ -141,7 +141,6 @@ UnderlinePop->addAction(UnderlineValAct); underlineButton = new QToolButton( this ); underlineButton->setText( "" ); - underlineButton->setIcon(im.loadIcon("unter.png")); underlineButton->setCheckable( true ); underlineButton->setMenu(UnderlinePop); underlineButton->setPopupMode(QToolButton::DelayedPopup); @@ -148,47 +147,45 @@ ssLayout->addWidget( underlineButton ); underlineWordButton = new QToolButton( this ); underlineWordButton->setText( "" ); - underlineWordButton->setIcon(im.loadIcon("wordsOnly.png")); underlineWordButton->setCheckable( true ); underlineWordButton->setMenu(UnderlinePop); underlineWordButton->setPopupMode(QToolButton::DelayedPopup); - ssLayout->addWidget( underlineWordButton ); + ssLayout->addWidget( underlineWordButton ); + StrikeVal = new StrikeValues( nullptr ); + StrikePop = new QMenu(); + StrikeValAct = new QWidgetAction(this); + StrikeValAct->setDefaultWidget(StrikeVal); + StrikePop->addAction(StrikeValAct); + strikeoutButton = new QToolButton( this ); + strikeoutButton->setText( "" ); + strikeoutButton->setCheckable( true ); + strikeoutButton->setMenu(StrikePop); + strikeoutButton->setPopupMode(QToolButton::DelayedPopup); + ssLayout->addWidget( strikeoutButton ); + ssLayout->addSpacing(12); + subscriptButton = new QToolButton( this ); subscriptButton->setText( "" ); - subscriptButton->setIcon(im.loadIcon("tief.png")); subscriptButton->setCheckable( true ); ssLayout->addWidget( subscriptButton ); superscriptButton = new QToolButton( this ); superscriptButton->setText( "" ); - superscriptButton->setIcon(im.loadIcon("hoch.png")); superscriptButton->setCheckable( true ); ssLayout->addWidget( superscriptButton ); + ssLayout->addSpacing(12); + allcapsButton = new QToolButton( this ); - allcapsButton->setMaximumSize( QSize( 22, 22 ) ); allcapsButton->setText(""); - allcapsButton->setIcon(im.loadIcon("AllCaps.png")); allcapsButton->setCheckable( true ); ssLayout->addWidget( allcapsButton ); smallcapsButton = new QToolButton( this ); smallcapsButton->setText(""); - smallcapsButton->setIcon(im.loadIcon("kapital.png")); smallcapsButton->setCheckable( true ); ssLayout->addWidget( smallcapsButton ); - StrikeVal = new StrikeValues( nullptr ); - StrikePop = new QMenu(); - StrikeValAct = new QWidgetAction(this); - StrikeValAct->setDefaultWidget(StrikeVal); - StrikePop->addAction(StrikeValAct); - strikeoutButton = new QToolButton( this ); - strikeoutButton->setText( "" ); - strikeoutButton->setIcon(im.loadIcon("strike.png")); - strikeoutButton->setCheckable( true ); - strikeoutButton->setMenu(StrikePop); - strikeoutButton->setPopupMode(QToolButton::DelayedPopup); - ssLayout->addWidget( strikeoutButton ); + ssLayout->addSpacing(12); OutlineVal = new OutlineValues( nullptr ); OutlinePop = new QMenu(); @@ -197,7 +194,6 @@ OutlinePop->addAction(OutlineValAct); outlineButton = new QToolButton( this ); outlineButton->setText( "" ); - outlineButton->setIcon(im.loadIcon("outlined.png")); outlineButton->setCheckable( true ); outlineButton->setMenu(OutlinePop); outlineButton->setPopupMode(QToolButton::DelayedPopup); @@ -210,33 +206,13 @@ ShadowPop->addAction(ShadowValAct); shadowButton = new QToolButton( this ); shadowButton->setText( "" ); - shadowButton->setIcon(im.loadIcon("shadow.png")); shadowButton->setCheckable( true ); shadowButton->setMenu(ShadowPop); shadowButton->setPopupMode(QToolButton::DelayedPopup); ssLayout->addWidget( shadowButton ); - - QSize s(24,24); - underlineButton->setMinimumSize(s); - underlineWordButton->setMinimumSize(s); - subscriptButton->setMinimumSize(s); - superscriptButton->setMinimumSize(s); - smallcapsButton->setMinimumSize(s); - allcapsButton->setMinimumSize(s); - strikeoutButton->setMinimumSize(s); - outlineButton->setMinimumSize(s); - shadowButton->setMinimumSize(s); - underlineButton->setMaximumSize(s); - underlineWordButton->setMaximumSize(s); - subscriptButton->setMaximumSize(s); - superscriptButton->setMaximumSize(s); - smallcapsButton->setMaximumSize(s); - allcapsButton->setMaximumSize(s); - strikeoutButton->setMaximumSize(s); - outlineButton->setMaximumSize(s); - shadowButton->setMaximumSize(s); languageChange(); + iconSetChange(); connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange())); @@ -267,35 +243,16 @@ { IconManager& im = IconManager::instance(); - underlineButton->setIcon(im.loadIcon("unter.png")); - underlineWordButton->setIcon(im.loadIcon("wordsOnly.png")); - subscriptButton->setIcon(im.loadIcon("tief.png")); - superscriptButton->setIcon(im.loadIcon("hoch.png")); - allcapsButton->setIcon(im.loadIcon("AllCaps.png")); - smallcapsButton->setIcon(im.loadIcon("kapital.png")); - strikeoutButton->setIcon(im.loadIcon("strike.png")); - outlineButton->setIcon(im.loadIcon("outlined.png")); - shadowButton->setIcon(im.loadIcon("shadow.png")); - - QSize s(24,24); - underlineButton->setMinimumSize(s); - underlineWordButton->setMinimumSize(s); - subscriptButton->setMinimumSize(s); - superscriptButton->setMinimumSize(s); - smallcapsButton->setMinimumSize(s); - allcapsButton->setMinimumSize(s); - strikeoutButton->setMinimumSize(s); - outlineButton->setMinimumSize(s); - shadowButton->setMinimumSize(s); - underlineButton->setMaximumSize(s); - underlineWordButton->setMaximumSize(s); - subscriptButton->setMaximumSize(s); - superscriptButton->setMaximumSize(s); - smallcapsButton->setMaximumSize(s); - allcapsButton->setMaximumSize(s); - strikeoutButton->setMaximumSize(s); - outlineButton->setMaximumSize(s); - shadowButton->setMaximumSize(s); + underlineButton->setIcon(im.loadIcon("character-underline")); + underlineWordButton->setIcon(im.loadIcon("character-underline-word")); + subscriptButton->setIcon(im.loadIcon("char |