From d613261e913f96cb088fa97c7f4a85b0e57e32c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 10 Jan 2020 17:27:04 +0000 Subject: [PATCH] Related: tdf#127782 resize the print dialog to its optimum size... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit after expander is activated Change-Id: I3f87243f0502829e048173987c8998898d351adf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86575 Tested-by: Jenkins Reviewed-by: Heiko Tietze (cherry picked from commit fa412876add97cab38d404723c49d35775f8efea) Related: tdf#127782 use size groups to avoid changing widths on using expanders Change-Id: I07335d466cf8f9fa1692372eeecbb484a2f4386d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86923 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit 0874fa237b3b6be3890915a744c5d34ba2bef8f7) change label in print dialog from "OK" to "Print" Change-Id: I1d6b04678ab039138908bc9555763bea057fa996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88212 Tested-by: Jenkins Reviewed-by: Heiko Tietze (cherry picked from commit aec3cce9e4aa12e6cfe229e11d6548f0c3a7cbb5) tdf#130517 improve accelerators on Print dialog page - add accelerator for Print - change accelerators for other "p" items - All Pages to A - Preview to v - Order (not needed, because _r on checkbox is enough) Change-Id: I7db4153829132dcbbb7c7356591f43df809583ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89127 Tested-by: Jenkins Reviewed-by: Seth Chaiklin Reviewed-by: Heiko Tietze (cherry picked from commit 5c3604542191b3c69da2d9d912c5c5a20c7143e9) missing use_underlines Change-Id: I2953069ee266c2a7850181826b299f0037a936ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90662 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit 80b4419d94e74b79330945aa76f06b0e62fe0d88) tdf#127782 - New Print dialog is too high ScrollWindow behind the tab control Change-Id: I5560f4368f94a45eeb1e3af3bf18df0f305ab3da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92758 Tested-by: Jenkins Reviewed-by: Heiko Tietze (cherry picked from commit 26ada4335a5804735ae37cf9a89f8145e0931fd7) --- sw/inc/strings.hrc | 2 +- vcl/inc/printdlg.hxx | 4 + vcl/source/window/printdlg.cxx | 9 + vcl/uiconfig/ui/printdialog.ui | 1721 ++++++++++++++++---------------- 4 files changed, 887 insertions(+), 849 deletions(-) diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 8c771426ef00..074681b65fae 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -621,7 +621,7 @@ #define STR_PRINTOPTUI_BROCHURE NC_("STR_PRINTOPTUI_BROCHURE", "Broch~ure") #define STR_PRINTOPTUI_LEFT_SCRIPT NC_("STR_PRINTOPTUI_LEFT_SCRIPT", "Left-to-right script") #define STR_PRINTOPTUI_RIGHT_SCRIPT NC_("STR_PRINTOPTUI_RIGHT_SCRIPT", "Right-to-left script") -#define STR_PRINTOPTUI_PRINTALLPAGES NC_("STR_PRINTOPTUI_PRINTALLPAGES", "All ~Pages") +#define STR_PRINTOPTUI_PRINTALLPAGES NC_("STR_PRINTOPTUI_PRINTALLPAGES", "~All Pages") #define STR_PRINTOPTUI_PRINTPAGES NC_("STR_PRINTOPTUI_PRINTPAGES", "Pa~ges:") #define STR_PRINTOPTUI_PRINTEVENPAGES NC_("STR_PRINTOPTUI_PRINTEVENPAGES", "~Even pages") #define STR_PRINTOPTUI_PRINTODDPAGES NC_("STR_PRINTOPTUI_PRINTODDPAGES", "~Odd pages") diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index 5e8289d6b4d1..9db2e07ca698 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -186,6 +186,8 @@ namespace vcl std::unique_ptr mxNupOrderWin; /// border around each page std::unique_ptr mxBorderCB; + std::unique_ptr mxRangeExpander; + std::unique_ptr mxLayoutExpander; std::unique_ptr mxCustom; OUString const maPrintToFileText; @@ -234,6 +236,8 @@ namespace vcl DECL_LINK( UIOption_SpinModifyHdl, weld::SpinButton&, void ); DECL_LINK( UIOption_EntryModifyHdl, weld::Entry&, void ); + DECL_LINK( ExpandHdl, weld::Expander&, void ); + css::beans::PropertyValue* getValueForWindow(weld::Widget*) const; void preparePreview( bool i_bMayUseCache ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 7d340559806a..ceb25a7e8609 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -566,6 +566,8 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const std::shared_ptrweld_check_button("bordercb")) + , mxRangeExpander(m_xBuilder->weld_expander("exRangeExpander")) + , mxLayoutExpander(m_xBuilder->weld_expander("exLayoutExpander")) , mxCustom(m_xBuilder->weld_widget("customcontents")) , maPrintToFileText( VclResId( SV_PRINT_TOFILE_TXT ) ) , maDefPrtText( VclResId( SV_PRINT_DEFPRT_TXT ) ) @@ -695,9 +697,16 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const std::shared_ptrconnect_value_changed( LINK( this, PrintDialog, MetricSpinModifyHdl ) ); mxSheetMarginEdt->connect_value_changed( LINK( this, PrintDialog, MetricSpinModifyHdl ) ); + mxRangeExpander->connect_expanded(LINK( this, PrintDialog, ExpandHdl)); + mxLayoutExpander->connect_expanded(LINK( this, PrintDialog, ExpandHdl)); + updateNupFromPages(); } +IMPL_LINK_NOARG(PrintDialog, ExpandHdl, weld::Expander&, void) +{ + m_xDialog->resize_to_request(); +} PrintDialog::~PrintDialog() { diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui index fc98a18a89a9..d0ebb7abe103 100644 --- a/vcl/uiconfig/ui/printdialog.ui +++ b/vcl/uiconfig/ui/printdialog.ui @@ -1,5 +1,5 @@ - + @@ -66,7 +66,7 @@ 0 0 dialog - + @@ -100,6 +100,7 @@ True True 10 + True False @@ -109,13 +110,13 @@ - gtk-ok + _Print True True True True True - True + True False @@ -145,38 +146,30 @@ - + True False - 6 + True + True - + True False + 6 + vertical + 12 - + True - True + False vertical - 6 - + True False - vertical - - - True - False - GDK_STRUCTURE_MASK | GDK_SCROLL_MASK - Print preview - - - True - True - 0 - - + GDK_STRUCTURE_MASK | GDK_SCROLL_MASK + Print preview + 6 True @@ -184,103 +177,29 @@ 0 + + + True + True + 0 + + + + + True + False - + True False + 6 - + True - False - 10 - 6 - - - True - True - True - Last page - imgLast - - - False - True - end - 0 - - - - - True - True - True - Next page - imgForward - - - False - False - end - 1 - - - - - True - False - / %n - - - False - True - end - 2 - - - - - True - True - 3 - 1 - - - False - True - end - 3 - - - - - True - True - True - Previous page - imgBack - - - False - False - end - 4 - - - - - True - True - True - First page - imgFirst - - - False - False - end - 5 - - + True + True + Last page + imgLast False @@ -290,49 +209,121 @@ - + + True + True + True + Next page + imgForward + + + False + False + end + 1 + + + + True False - 10 - 3 - - - Preview - True - True - False - center - True - True - True - - - False - True - end - 0 - - + / %n + + + False + True + end + 2 + + + + + True + True + 3 + 1 False True + end + 3 + + + + + True + True + True + Previous page + imgBack + + + False + False + end 4 + + + True + True + True + First page + imgFirst + + + False + False + end + 5 + + False True end - 1 + 0 + + + + + True + False + 3 + + + Pre_view + True + True + False + center + True + True + True + + + False + True + end + 0 + + + + + False + True + 4 - True + False True - 0 + end + 1 @@ -343,65 +334,52 @@ - + True - False - vertical + True + 6 + True + True - + True True - True - True + in + 500 + 450 - + True False - 6 - vertical - 12 - + True False - 0 - none + 6 + vertical + 12 - + True False - 6 - 12 + 0 + none - + True False - vertical - 6 - - - True - False - - - False - True - 0 - - + 6 + 12 - + True False + vertical 6 - + True False - Status: - - - False @@ -410,13 +388,55 @@ - + True False - Default Printer - - - + 6 + + + True + False + Status: + + + + + + False + True + 0 + + + + + True + False + Default Printer + + + + + + False + True + 1 + + + + + Properties... + True + True + True + end + + + False + True + end + 2 + + False @@ -424,217 +444,82 @@ 1 - - - Properties... - True - True - True - end - - - False - True - end - 2 - - - - False - True - 1 - + + + True + False + Printer + True + printersbox + + + + + + + False + True + 0 + - - - True - False - Printer - True - printersbox - - - - - - - - False - True - 0 - - - - - True - False - 0 - none - + True False - 6 - 12 + 0 + none - + True False - 2 - 6 - - - _All pages - True - True - False - start - 2 - True - True - True - - - 0 - 0 - 2 - - - - - _Pages: - True - True - False - start - 2 - 2 - True - True - rbAllPages - - - 0 - 1 - - - - - True - True - True - True - e.g.: 1, 3-5, 7, 9 - - - 1 - 1 - - - - - _Even pages - True - True - False - start - 2 - 2 - True - True - rbAllPages - - - 0 - 2 - 2 - - - - - _Odd pages - True - True - False - start - 2 - 2 - True - True - rbAllPages - - - 0 - 3 - 2 - - + 6 + 12 - - _Selection - True - False - start - 2 - True - True - rbAllPages - - - 0 - 4 - 2 - - - - + True - True - True - True + False + 6 - + True False 2 6 - - False + + _All pages + True + True + False start - _From which print: + 2 True - printextrabox + True + True 0 0 - - - - - False - True - - - 1 - 0 2 - + + _Pages: True - False + True + False start - Paper _sides: + 2 + 2 True - sidesbox + True + rbAllPages 0 @@ -642,635 +527,763 @@ - + True - False + True True - - Print on one side (simplex) - Print on both sides (duplex long edge) - Print on both sides (duplex short edge) - + True + e.g.: 1, 3-5, 7, 9 1 1 - 2 - + + _Even pages True - False + True + False start - _Number of copies: + 2 + 2 True - copycount + True + rbAllPages 0 2 + 2 - + + _Odd pages True True - center - True - True - 1 - adjustment2 - 1 + False + start + 2 + 2 + True + True + rbAllPages - 1 - 2 + 0 + 3 + 2 + + + + + _Selection + True + False + start + 2 + True + True + rbAllPages + + + 0 + 4 + 2 + + + 0 + 0 + + + + + True + True + True - + True False - end - 4 + 2 + 6 + + + False + start + _From which print: + True + printextrabox + + + 0 + 0 + + + + + False + True + + + 1 + 0 + + + + + True + False + start + Paper _sides: + True + sidesbox + + + 0 + 1 + + + + + True + False + True + + Print on one side (simplex) + Print on both sides (duplex long edge) + Print on both sides (duplex short edge) + + + + 1 + 1 + + + + + True + False + start + _Number of copies: + True + copycount + + + 0 + 2 + + + + + True + True + center + True + True + 1 + adjustment2 + 1 + + + 1 + 2 + + + + + True + False + start + Order: + True + reverseorder + + + 0 + 4 + 2 + + - - _Collate + + Print in _reverse order True True False + start True True - False - True - 0 + 1 + 4 - + True False - gtk-missing-image + start + 4 + + + _Collate + True + True + False + True + True + + + False + True + 0 + + + + + True + False + gtk-missing-image + + + False + True + 1 + + - False - True - 1 + 1 + 3 + + + - - 2 - 2 - - - + + True False - start - _Order: - True - reverseorder - - - 0 - 3 - - - - - Print in _reverse order - True - True - False - start + _more True - True - - 1 - 3 - 2 - - - - - True - False - _more - True - + + 0 + 1 + - - 0 - 5 - 2 - + + + True + False + Range and Copies + + + + + + + False + True + 1 + - - - True - False - Range and Copies - grid1 - - - - - - - - False - True - 1 - - - - - True - False - 0 - none - + True False - 6 - 12 + 0 + none - + True False - 6 - 6 + 6 + 12 - + True False - start - Orientation: - True - pageorientationbox - - - 0 - 1 - - - - - True - False - start - Paper size: - True - papersizebox - - - 0 - 0 - - - - - True - False - True - 0 - - Automatic - Portrait - Landscape - - - - 1 - 1 - - - - - True - False - True - - - 1 - 0 - - - - - True - True - True - True + 6 - + True False 6 6 - + True False - 3 - - - Pages per sheet: - True - True - False - start - True - True - True - - - - - - False - True - 0 - - - - - True - False - - - False - True - 1 - - + start + Orientation: + True + pageorientationbox 0 - 0 + 1 - + True - False - True - 0 - - 1 - 2 - 4 - 6 - 9 - 16 - Custom - - - - - - - 1 - 0 - 3 - - - - False start - Pages: + Paper size: True - pagerows + papersizebox 0 - 1 - - - - - True - True - 1 - adjustment3 - 1 - - - 1 - 1 + 0 - + + True False - by - True - pagecols - - - 2 - 1 - - - - - True - True - 1 - adjustment4 - 1 + True + 0 + + Automatic + Portrait + Landscape + - 3 + 1 1 - + + True False - start - Margin: - True - pagemarginsb - - - 0 - 2 - - - - - True - True - 0 - adjustment5 + True 1 - 2 + 0 + + + 0 + 0 + + + + + True + True + True - + + True False - start - between pages - - - 2 - 2 - 2 - - - - - False - start - Distance: - True - sheetmarginsb - - - 0 - 3 - - - - - True - True - 0 - adjustment6 - - - 1 - 3 - - - - - False - start - to sheet border - - - 2 - 3 - 2 - - - - - True - False - start - Order: - True - orderbox + 6 + 6 + + + True + False + 3 + + + Pages per sheet: + True + True + False + start + True + True + True + + + + + + False + True + 0 + + + + + True + False + + + False + True + 1 + + + + + 0 + 0 + + + + + True + False + True + 0 + + 1 + 2 + 4 + 6 + 9 + 16 + Custom + + + + + + + 1 + 0 + 3 + + + + + False + start + Pages: + True + pagerows + + + 0 + 1 + + + + + True + True + 1 + adjustment3 + 1 + + + 1 + 1 + + + + + False + by + True + pagecols + + + 2 + 1 + + + + + True + True + 1 + adjustment4 + 1 + + + 3 + 1 + + + + + False + start + Margin: + True + pagemarginsb + + + 0 + 2 + + + + + True + True + 0 + adjustment5 + + + 1 + 2 + + + + + False + start + between pages + + + 2 + 2 + 2 + + + + + False + start + Distance: + True + sheetmarginsb + + + 0 + 3 + + + + + True + True + 0 + adjustment6 + + + 1 + 3 + + + + + False + start + to sheet border + + + 2 + 3 + 2 + + + + + True + False + start + Order: + True + orderbox + + + 0 + 4 + + + + + True + False + True + + Left to right, then down + Top to bottom, then right + Top to bottom, then left + Right to left, then down + + + + 1 + 4 + 3 + + + + + Draw a border around each page + True + True + False + start + True + True + + + 0 + 5 + 4 + + + + + Brochure + True + True + False + start + True + True + pagespersheetbtn + + + 0 + 6 + + + + + False + + + 1 + 6 + 3 + + + + + True + False + Collation preview + center + start + + + 4 + 4 + + + + + + + + + + + + + + + + + + + + - - 0 - 4 - - - + + True False - True - - Left to right, then down - Top to bottom, then right - Top to bottom, then left - Right to left, then down - - - - 1 - 4 - 3 - - - - - Draw a border around each page - True - True - False - start + m_ore True - True - - 0 - 5 - 4 - - - - Brochure - True - True - False - start - True - True - pagespersheetbtn - - - 0 - 6 - - - - - False - - - 1 - 6 - 3 - - - - - True - False - Collation preview - center - start - - - 4 - 4 - - - - - - - - - - - - - - - - - - - - - - - - - True - False - m_ore - True + + 0 + 1 + - - 0 - 2 - 2 - + + + True + False + Page Layout + + + + + - - - - True - False - Page Layout - - - - + + False + True + 2 + - - False - True - 2 - - - - True - False - General - - - False - - + + + + + True + False + General + + + False + + + + + True + False + 6 + vertical - - True - False - 6 - vertical - - - - - - 1 - - - - - True - False - custom - - - 1 - False - + - True - True - 0 + 1 + + + + + True + False + custom + + + 1 + False - True + False True 1 - True + False True 0 @@ -1278,6 +1291,18 @@ + + + + + + + + + + + + -- 2.25.3