GNOME Bugzilla – Bug 729011
improve Print preview
Last modified: 2020-11-24 10:00:25 UTC
try this : 1. Open a document in gedit 2. CTRL-P to print document 3. Choose Preview : 4. If you decided that the document is ready to print there isn't any "Print button" in the preview toolbar. 5. Then you may close the preview mode to return in print window to perform some changes before print, but this operation close also the print window and you return in gedit window. so : 1) Is it possible add a Print button in preview toolbar? 2) Is it possible return to print mode when you close the preview mode? Thanks Andrea
This is indeed true. It is due to the fact that the preview widget did not change when we modernized the UI and before there was a print button in the toolbar.
In general here is a list of things to fix there: * add a print button * make sure vertical sizing of stuff in the inline toolbar is more uniform and use baseline alignment * use symbolics for the icons * use a popover for the 2x2, 4x4 selector * use a gray background for the pages * center the pages * maybe try a OSD toolbar instead of an inline toolbar
Created attachment 294581 [details] [review] Fix margin for Gridbox
Created attachment 294582 [details] After margin set
Created attachment 294583 [details] Before margin unset
Created attachment 294593 [details] [review] Fix alignment for gridbox
Review of attachment 294593 [details] [review]: pushed
Just for clarity of the discussion (that has happened on IRC) there are two sides of this bug: 1) The interaction problem * if/how print directly from the preview * if/how return to the print settings dialog from the preview 2) A visual refresh of the preview UI Some suggestions for (2) are in comment #2. For (1) we have the following possibilities (or a combination of them) a) add back a print button in the preview inline toolbar that prints directly b) add print settings button to the preview inline toolbar that reopens the print dialog c) make "close" close the preview and bring back the dialog The combinations that make sense are * only (a) * only (b) * (a) and (b) * (a) and (c) * only (c) Depending on whether we think preview->print and preview->tweak settings are common operations I am leaning toward (a + b) or only (b) since having to go back through the dialog to do the final print is not so bad I do not like much (c) since it is a bit surprising that close pops the dialog back up
Created attachment 294854 [details] [review] Adding print button Added print button. It closes the preview which we are seeing and shows the print dialog for further operation.
Created attachment 294858 [details] [review] Adding print button Added print button. It closes the preview which we are seeing and shows the print dialog for further operation.
Comment on attachment 294858 [details] [review] Adding print button Typo in gedit-print-job.c
Created attachment 294862 [details] [review] Remove deprecated property Use icon_name instead of stock_id.
Review of attachment 294862 [details] [review]: this does not look correct. The icons are not called gtk-something For instance [paolo@murdock gedit]$ find /usr/share/icons/Adwaita/ | grep zoom /usr/share/icons/Adwaita/22x22/actions/zoom-out.png /usr/share/icons/Adwaita/22x22/actions/zoom-original.png /usr/share/icons/Adwaita/22x22/actions/zoom-in.png /usr/share/icons/Adwaita/22x22/actions/zoom-fit-best.png ...
Created attachment 294890 [details] [review] Improve print preview Use control mask with scroll up and scroll down to zoom in/out document.
Review of attachment 294890 [details] [review]: See the comments ::: gedit/gedit-print-preview.c @@ +558,3 @@ +static gboolean +scroll_event_activated (GtkWidget *button, this is not a button, is it? @@ +580,3 @@ + zoom_out (preview); + } + if (event->delta_y < 0) this should be else if @@ +583,3 @@ + { + zoom_in (preview); + } missing return?
(In reply to comment #13) > Review of attachment 294862 [details] [review]: > > this does not look correct. The icons are not called gtk-something > > For instance > > > [paolo@murdock gedit]$ find /usr/share/icons/Adwaita/ | grep zoom > /usr/share/icons/Adwaita/22x22/actions/zoom-out.png > /usr/share/icons/Adwaita/22x22/actions/zoom-original.png > /usr/share/icons/Adwaita/22x22/actions/zoom-in.png > /usr/share/icons/Adwaita/22x22/actions/zoom-fit-best.png > ... Yes I was confused with the names. can you guide me how should I locate the actual names of icons. or should I use the icon_name properties suggestion for names ? Or by using the simple find command ?
Created attachment 294892 [details] [review] Improve print preview
Review of attachment 294892 [details] [review]: See the commetns ::: gedit/gedit-print-preview.c @@ +564,3 @@ + if (event->state & GDK_CONTROL_MASK) + { + if (event->direction == GDK_SCROLL_UP) I guess you could handle it in this way too: if ((event->direction == GDK_SCROLL_UP) || (event->direction == GDK_SCROLL_SMOOTH && event->delta_y < 0)) { } else if ((event->direction == GDK_SCROLL_DOWN) || (event->direction == GDK_SCROLL_SMOOTH && event->delta_y < 0)) { } @@ +585,3 @@ + zoom_in (preview); + return GDK_EVENT_STOP; + } put the return here so you save one line
Created attachment 294945 [details] [review] Remove deprecated property Corrected the icon_name.
Created attachment 294946 [details] [review] Improve print preview Merged If conditions.
Created attachment 294949 [details] [review] Remove xalign for buttons
Created attachment 294950 [details] [review] Remove deprecated property
Review of attachment 294950 [details] [review]: pushed
Review of attachment 294949 [details] [review]: pushed
Review of attachment 294946 [details] [review]: pushed
Review of attachment 294854 [details] [review]: I do not like this implementation because it causes a reference loop, the tab owns a ref to the print job, the print job owns a ref to the preview, the preview owns a ref to the tab. I think we should make the preview emit a "print" signal when print is clicked and then close the preview and show the dialog from the tab
Created attachment 295666 [details] [review] Adding print button Added print signal which emits when print button clicked, it goes to _gedit_tab_print which checks tab state which is equal to PRINT_PREVIEW state so that it destroy the print preview and show the print dialog settings.
Created attachment 295667 [details] [review] Adding print button Added print signal which emits when print button clicked, it goes to _gedit_tab_print which checks tab state which is equal to PRINT_PREVIEW state so that it destroy the print preview and show the print dialog settings.
Mass-closing of all gedit bugzilla tickets. Special "code" to find again all those gedit bugzilla tickets that were open before the mass-closing: 2bfe1b0590a78457e1f1a6a90fb975f5878cb60064ccfe1d7db76ca0da52f0f3 By searching the above sha256sum in bugzilla, the gedit contributors can find again the tickets. We may be interested to do so when we work on a specific area of the code, to at least know the known problems and possible enhancements. We do this mass-closing because bugzilla.gnome.org is being replaced by gitlab.gnome.org.