mate-desktop / mate-terminal

The MATE Terminal Emulator
http://www.mate-desktop.org
GNU General Public License v3.0
133 stars 73 forks source link

Add tab scrolling support for GTK3 #358

Closed tamplan closed 4 years ago

tamplan commented 4 years ago

closes #297

rbuj commented 4 years ago

Test for computing leading spaces:

$ git rebase master
$ git diff master | grep '^+ .*' | sed 's/^+//g' | awk '{match($0, /^ */); printf("There are %d spaces leading up to %s\n", RLENGTH, substr($0,RLENGTH+1)) }'
There are 2 spaces leading up to w = GTK_WIDGET (gtk_builder_get_object (builder, "profile-editor-notebook"));
There are 2 spaces leading up to gtk_widget_add_events (w, GDK_SCROLL_MASK);
There are 2 spaces leading up to g_signal_connect (w,
<cut>
There are 2 spaces leading up to GtkNotebook *notebook = GTK_NOTEBOOK (widget);
There are 2 spaces leading up to GtkWidget *child, *event_widget, *action_widget;
There are 2 spaces leading up to child = gtk_notebook_get_nth_page (notebook, gtk_notebook_get_current_page (notebook));
There are 2 spaces leading up to if (child == NULL)
There are 6 spaces leading up to return FALSE;
There are 2 spaces leading up to event_widget = gtk_get_event_widget ((GdkEvent*) event);
There are 2 spaces leading up to /* Ignore scroll events from the content of the page */
There are 2 spaces leading up to if (event_widget == NULL || event_widget == child || gtk_widget_is_ancestor (event_widget, child))
There are 6 spaces leading up to return FALSE;
There are 2 spaces leading up to /* And also from the action widgets */
There are 2 spaces leading up to action_widget = gtk_notebook_get_action_widget (notebook, GTK_PACK_START);
There are 2 spaces leading up to if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget)))
There are 6 spaces leading up to return FALSE;
There are 2 spaces leading up to action_widget = gtk_notebook_get_action_widget(notebook, GTK_PACK_END);
There are 2 spaces leading up to if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget)))
There are 6 spaces leading up to return FALSE;
There are 2 spaces leading up to switch (event->direction)
There are 2 spaces leading up to {
There are 6 spaces leading up to case GDK_SCROLL_RIGHT:
There are 6 spaces leading up to case GDK_SCROLL_DOWN:
There are 10 spaces leading up to gtk_notebook_next_page (notebook);
There are 10 spaces leading up to break;
There are 6 spaces leading up to case GDK_SCROLL_LEFT:
There are 6 spaces leading up to case GDK_SCROLL_UP:
There are 10 spaces leading up to gtk_notebook_prev_page (notebook);
There are 10 spaces leading up to break;
There are 6 spaces leading up to case GDK_SCROLL_SMOOTH:
There are 10 spaces leading up to break;
There are 2 spaces leading up to }
There are 2 spaces leading up to return TRUE;
<cut>

2, 6 (2+4) and 10 (2+4+4) are not multiple of four.

tamplan commented 4 years ago

git rebase master git diff master | grep '^+ .' | sed 's/^+//g' | awk '{match($0, /^ /); printf("There are %d spaces leading up to %s\n", RLENGTH, substr($0,RLENGTH+1)) }'

I don't have the same results: ` $ git rebase master

$ git diff master | grep '^+ .' | sed 's/^+//g' | awk '{match($0, /^ /); printf("There are %d spaces leading up to %s\n", RLENGTH, substr($0,RLENGTH+1)) }' There are 2 spaces leading up to w = GTK_WIDGET (gtk_builder_get_object (builder, "profile-editor-notebook")); There are 2 spaces leading up to gtk_widget_add_events (w, GDK_SCROLL_MASK); There are 2 spaces leading up to g_signal_connect (w, There are 20 spaces leading up to "scroll-event", There are 20 spaces leading up to G_CALLBACK (terminal_profile_edit_dialog_page_scroll_event_cb), There are 20 spaces leading up to NULL); There are 51 spaces leading up to GdkEventScroll event) There are 2 spaces leading up to GtkNotebook notebook = GTK_NOTEBOOK (widget); There are 2 spaces leading up to GtkWidget child, event_widget, action_widget; There are 2 spaces leading up to child = gtk_notebook_get_nth_page (notebook, gtk_notebook_get_current_page (notebook)); There are 2 spaces leading up to if (child == NULL) There are 6 spaces leading up to return FALSE; There are 2 spaces leading up to event_widget = gtk_get_event_widget ((GdkEvent) event); There are 2 spaces leading up to / Ignore scroll events from the content of the page / There are 2 spaces leading up to if (event_widget == NULL || event_widget == child || gtk_widget_is_ancestor (event_widget, child)) There are 6 spaces leading up to return FALSE; There are 2 spaces leading up to / And also from the action widgets / There are 2 spaces leading up to action_widget = gtk_notebook_get_action_widget (notebook, GTK_PACK_START); There are 2 spaces leading up to if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget))) There are 6 spaces leading up to return FALSE; There are 2 spaces leading up to action_widget = gtk_notebook_get_action_widget(notebook, GTK_PACK_END); There are 2 spaces leading up to if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget))) There are 6 spaces leading up to return FALSE; There are 2 spaces leading up to switch (event->direction) There are 2 spaces leading up to { There are 6 spaces leading up to case GDK_SCROLL_RIGHT: There are 6 spaces leading up to case GDK_SCROLL_DOWN: There are 10 spaces leading up to gtk_notebook_next_page (notebook); There are 10 spaces leading up to break; There are 6 spaces leading up to case GDK_SCROLL_LEFT: There are 6 spaces leading up to case GDK_SCROLL_UP: There are 10 spaces leading up to gtk_notebook_prev_page (notebook); There are 10 spaces leading up to break; There are 6 spaces leading up to case GDK_SCROLL_SMOOTH: There are 10 spaces leading up to break; There are 2 spaces leading up to } There are 2 spaces leading up to return TRUE; There are 67 spaces leading up to GdkEventScroll *event); ` With a strange line with 67 spaces! Ok, i control the file again with 4 spaces, thanks for help.

tamplan commented 4 years ago

I can manage to squash the commits, can i delete the repository, refork it and repurpose the same PR to not waste time?

rbuj commented 4 years ago

I can manage to squash the commits, can i delete the repository, refork it and repurpose the same PR to not waste time?

After modifying the files on your local BRANCH_NAME and if there is only one commit you can use git commit --amend as follows:

git add file1.c
git commit --amend
git push origin BRANCH_NAME -f
tamplan commented 4 years ago

I can manage to squash the commits, can i delete the repository, refork it and repurpose the same PR to not waste time?

After modifying the files on your local BRANCH_NAME and if there is only one commit you can use git commit --amend as follows:

git add file1.c
git commit --amend
git push origin BRANCH_NAME -f

Sorry, i would like to write "i can't" instead of "i can", i have got a warning message, to be sure not add more problem in git historic i purpose to delete my fork and repurpose the PR. Now, the PR was merged, so i have no problem now. Thanks any way for your help.

rbuj commented 4 years ago

@tamplan You can include close keyword in your pull request descriptions to automatically close issues in github. See https://help.github.com/en/enterprise/2.16/user/github/managing-your-work-on-github/closing-issues-using-keywords

tamplan commented 4 years ago

Ok, thanks for the tip.