Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
yad
Commits
f72acd1e
Commit
f72acd1e
authored
Apr 17, 2021
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve keyboard shortcuts
parent
217bb414
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
html.c
src/html.c
+17
-5
text.c
src/text.c
+1
-1
No files found.
src/html.c
View file @
f72acd1e
...
...
@@ -202,8 +202,7 @@ open_cb (GSimpleAction *act, GVariant *param, gpointer d)
{
GtkWidget
*
dlg
,
*
cnt
,
*
lbl
,
*
entry
;
dlg
=
gtk_dialog_new_with_buttons
(
_
(
"Open URI"
),
GTK_WINDOW
(
gtk_widget_get_toplevel
(
GTK_WIDGET
(
view
))),
dlg
=
gtk_dialog_new_with_buttons
(
_
(
"Open URI"
),
GTK_WINDOW
(
d
),
GTK_DIALOG_DESTROY_WITH_PARENT
,
_
(
"Cancel"
),
GTK_RESPONSE_REJECT
,
_
(
"Open"
),
GTK_RESPONSE_ACCEPT
,
...
...
@@ -247,7 +246,7 @@ menu_cb (WebKitWebView *view, WebKitContextMenu *menu, GdkEvent *ev, WebKitHitTe
webkit_context_menu_prepend
(
menu
,
mi
);
act
=
g_simple_action_new
(
"open"
,
NULL
);
g_signal_connect
(
G_OBJECT
(
act
),
"activate"
,
G_CALLBACK
(
open_cb
),
NULL
);
g_signal_connect
(
G_OBJECT
(
act
),
"activate"
,
G_CALLBACK
(
open_cb
),
d
);
mi
=
webkit_context_menu_item_new_from_gaction
(
G_ACTION
(
act
),
_
(
"Open URI"
),
NULL
);
webkit_context_menu_prepend
(
menu
,
mi
);
...
...
@@ -256,7 +255,7 @@ menu_cb (WebKitWebView *view, WebKitContextMenu *menu, GdkEvent *ev, WebKitHitTe
webkit_context_menu_append
(
menu
,
mi
);
act
=
g_simple_action_new
(
"quit"
,
NULL
);
g_signal_connect
(
G_OBJECT
(
act
),
"activate"
,
G_CALLBACK
(
quit_cb
),
NULL
);
g_signal_connect
(
G_OBJECT
(
act
),
"activate"
,
G_CALLBACK
(
quit_cb
),
d
);
mi
=
webkit_context_menu_item_new_from_gaction
(
G_ACTION
(
act
),
_
(
"Quit"
),
NULL
);
webkit_context_menu_append
(
menu
,
mi
);
...
...
@@ -264,6 +263,18 @@ menu_cb (WebKitWebView *view, WebKitContextMenu *menu, GdkEvent *ev, WebKitHitTe
return
FALSE
;
}
static
gboolean
key_press_cb
(
GtkWidget
*
w
,
GdkEventKey
*
key
,
gpointer
d
)
{
if
((
key
->
state
&
GDK_CONTROL_MASK
)
&&
(
key
->
keyval
==
GDK_KEY_O
||
key
->
keyval
==
GDK_KEY_o
))
{
open_cb
(
NULL
,
NULL
,
d
);
return
TRUE
;
}
return
FALSE
;
}
static
void
title_cb
(
GObject
*
obj
,
GParamSpec
*
spec
,
GtkWindow
*
dlg
)
{
...
...
@@ -380,7 +391,8 @@ html_create_widget (GtkWidget * dlg)
if
(
options
.
html_data
.
browser
)
{
g_signal_connect
(
view
,
"context-menu"
,
G_CALLBACK
(
menu_cb
),
NULL
);
g_signal_connect
(
view
,
"context-menu"
,
G_CALLBACK
(
menu_cb
),
dlg
);
g_signal_connect
(
view
,
"key-press-event"
,
G_CALLBACK
(
key_press_cb
),
dlg
);
if
(
!
options
.
data
.
dialog_title
)
g_signal_connect
(
view
,
"notify::title"
,
G_CALLBACK
(
title_cb
),
dlg
);
if
(
!
options
.
data
.
window_icon
)
...
...
src/text.c
View file @
f72acd1e
...
...
@@ -587,7 +587,7 @@ text_create_widget (GtkWidget * dlg)
}
#endif
/* Add
submit on ctrl+ent
er */
/* Add
keyboard handl
er */
g_signal_connect
(
text_view
,
"key-press-event"
,
G_CALLBACK
(
key_press_cb
),
dlg
);
/* Initialize linkifying */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment