After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729011 - improve Print preview
improve Print preview
Status: RESOLVED OBSOLETE
Product: gedit
Classification: Applications
Component: printing
3.12.x
Other Linux
: Normal enhancement
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-26 09:51 UTC by Andrea Antolini
Modified: 2020-11-24 10:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix margin for Gridbox (967 bytes, patch)
2015-01-15 09:42 UTC, Sagar Ghuge
none Details | Review
After margin set (24.92 KB, image/png)
2015-01-15 09:55 UTC, Sagar Ghuge
  Details
Before margin unset (21.91 KB, image/png)
2015-01-15 09:56 UTC, Sagar Ghuge
  Details
Fix alignment for gridbox (988 bytes, patch)
2015-01-15 12:29 UTC, Sagar Ghuge
committed Details | Review
Adding print button (5.47 KB, patch)
2015-01-19 11:04 UTC, Sagar Ghuge
needs-work Details | Review
Adding print button (5.47 KB, patch)
2015-01-19 11:08 UTC, Sagar Ghuge
none Details | Review
Remove deprecated property (2.82 KB, patch)
2015-01-19 11:48 UTC, Sagar Ghuge
none Details | Review
Improve print preview (1.74 KB, patch)
2015-01-19 14:25 UTC, Sagar Ghuge
needs-work Details | Review
Improve print preview (1.80 KB, patch)
2015-01-19 14:41 UTC, Sagar Ghuge
needs-work Details | Review
Remove deprecated property (2.82 KB, patch)
2015-01-20 05:28 UTC, Sagar Ghuge
none Details | Review
Improve print preview (1.68 KB, patch)
2015-01-20 05:55 UTC, Sagar Ghuge
committed Details | Review
Remove xalign for buttons (1.85 KB, patch)
2015-01-20 06:44 UTC, Sagar Ghuge
committed Details | Review
Remove deprecated property (2.37 KB, patch)
2015-01-20 07:08 UTC, Sagar Ghuge
committed Details | Review
Adding print button (6.43 KB, patch)
2015-01-28 13:17 UTC, Sagar Ghuge
none Details | Review
Adding print button (6.43 KB, patch)
2015-01-28 13:20 UTC, Sagar Ghuge
none Details | Review

Description Andrea Antolini 2014-04-26 09:51:30 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
Comment 1 Paolo Borelli 2014-07-20 15:15:59 UTC
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.
Comment 2 Paolo Borelli 2014-07-20 15:23:59 UTC
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
Comment 3 Sagar Ghuge 2015-01-15 09:42:10 UTC
Created attachment 294581 [details] [review]
Fix margin for Gridbox
Comment 4 Sagar Ghuge 2015-01-15 09:55:47 UTC
Created attachment 294582 [details]
After margin set
Comment 5 Sagar Ghuge 2015-01-15 09:56:06 UTC
Created attachment 294583 [details]
Before margin unset
Comment 6 Sagar Ghuge 2015-01-15 12:29:59 UTC
Created attachment 294593 [details] [review]
Fix alignment for gridbox
Comment 7 Paolo Borelli 2015-01-15 13:14:07 UTC
Review of attachment 294593 [details] [review]:

pushed
Comment 8 Paolo Borelli 2015-01-16 13:51:42 UTC
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
Comment 9 Sagar Ghuge 2015-01-19 11:04:13 UTC
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.
Comment 10 Sagar Ghuge 2015-01-19 11:08:09 UTC
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 11 Sagar Ghuge 2015-01-19 11:11:53 UTC
Comment on attachment 294858 [details] [review]
Adding print button

Typo in gedit-print-job.c
Comment 12 Sagar Ghuge 2015-01-19 11:48:18 UTC
Created attachment 294862 [details] [review]
Remove deprecated property

Use icon_name instead of stock_id.
Comment 13 Paolo Borelli 2015-01-19 14:01:43 UTC
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
...
Comment 14 Sagar Ghuge 2015-01-19 14:25:08 UTC
Created attachment 294890 [details] [review]
Improve print preview

Use control mask with scroll up and scroll down to zoom in/out document.
Comment 15 Ignacio Casal Quinteiro (nacho) 2015-01-19 14:26:52 UTC
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?
Comment 16 Sagar Ghuge 2015-01-19 14:32:20 UTC
(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 ?
Comment 17 Sagar Ghuge 2015-01-19 14:41:52 UTC
Created attachment 294892 [details] [review]
Improve print preview
Comment 18 Ignacio Casal Quinteiro (nacho) 2015-01-19 14:48:27 UTC
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
Comment 19 Sagar Ghuge 2015-01-20 05:28:57 UTC
Created attachment 294945 [details] [review]
Remove deprecated property

Corrected the icon_name.
Comment 20 Sagar Ghuge 2015-01-20 05:55:48 UTC
Created attachment 294946 [details] [review]
Improve print preview

Merged If conditions.
Comment 21 Sagar Ghuge 2015-01-20 06:44:44 UTC
Created attachment 294949 [details] [review]
Remove xalign for buttons
Comment 22 Sagar Ghuge 2015-01-20 07:08:38 UTC
Created attachment 294950 [details] [review]
Remove deprecated property
Comment 23 Paolo Borelli 2015-01-24 10:48:31 UTC
Review of attachment 294950 [details] [review]:

pushed
Comment 24 Paolo Borelli 2015-01-24 10:48:31 UTC
Review of attachment 294950 [details] [review]:

pushed
Comment 25 Paolo Borelli 2015-01-24 10:48:54 UTC
Review of attachment 294949 [details] [review]:

pushed
Comment 26 Paolo Borelli 2015-01-24 10:49:19 UTC
Review of attachment 294946 [details] [review]:

pushed
Comment 27 Paolo Borelli 2015-01-24 10:54:11 UTC
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
Comment 28 Sagar Ghuge 2015-01-28 13:17:03 UTC
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.
Comment 29 Sagar Ghuge 2015-01-28 13:20:07 UTC
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.
Comment 30 Sébastien Wilmet 2020-11-24 10:00:25 UTC
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.