Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
80f2deb9
Commit
80f2deb9
authored
Nov 03, 2015
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed fonts in the chat web view
parent
afc68db1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
14 deletions
+11
-14
chatwindow.py
blink/chatwindow.py
+3
-12
preferences.py
blink/preferences.py
+3
-2
template.html
resources/chat/template.html
+5
-0
No files found.
blink/chatwindow.py
View file @
80f2deb9
...
...
@@ -378,16 +378,6 @@ class ChatWebView(QWebView):
self
.
setAttribute
(
Qt
.
WA_OpaquePaintEvent
,
False
)
self
.
settings
()
.
setAttribute
(
QWebSettings
.
DeveloperExtrasEnabled
,
True
)
# temporary for debugging -Dan
def
setChatFont
(
self
,
family
,
size
):
settings
=
self
.
settings
()
settings
.
setFontFamily
(
QWebSettings
.
StandardFont
,
family
)
settings
.
setFontFamily
(
QWebSettings
.
FixedFont
,
family
)
settings
.
setFontFamily
(
QWebSettings
.
SerifFont
,
family
)
settings
.
setFontFamily
(
QWebSettings
.
SansSerifFont
,
family
)
settings
.
setFontSize
(
QWebSettings
.
DefaultFontSize
,
size
)
settings
.
setFontSize
(
QWebSettings
.
DefaultFixedFontSize
,
size
)
self
.
update
()
def
contextMenuEvent
(
self
,
event
):
menu
=
self
.
page
()
.
createStandardContextMenu
()
if
any
(
action
.
isVisible
()
and
not
action
.
isSeparator
()
for
action
in
menu
.
actions
()):
...
...
@@ -574,9 +564,10 @@ class ChatWidget(base_class, ui_class):
blink_settings
=
BlinkSettings
()
self
.
style
=
ChatMessageStyle
(
blink_settings
.
chat_window
.
style
)
self
.
style_variant
=
blink_settings
.
chat_window
.
style_variant
or
self
.
style
.
default_variant
self
.
font_family
=
blink_settings
.
chat_window
.
font
or
self
.
style
.
font_family
self
.
font_size
=
blink_settings
.
chat_window
.
font_size
or
self
.
style
.
font_size
self
.
user_icons_css_class
=
'show-icons'
if
blink_settings
.
chat_window
.
show_user_icons
else
'hide-icons'
self
.
chat_view
.
setChatFont
(
blink_settings
.
chat_window
.
font
or
self
.
style
.
font_family
,
blink_settings
.
chat_window
.
font_size
or
self
.
style
.
font_size
)
self
.
chat_view
.
setHtml
(
self
.
chat_template
.
format
(
base_url
=
FileURL
(
self
.
style
.
path
)
+
'/'
,
style_url
=
self
.
style_variant
+
'.style'
))
self
.
chat_view
.
setHtml
(
self
.
chat_template
.
format
(
base_url
=
FileURL
(
self
.
style
.
path
)
+
'/'
,
style_url
=
self
.
style_variant
+
'.style'
,
font_family
=
self
.
font_family
,
font_size
=
self
.
font_size
))
self
.
chat_element
=
self
.
chat_view
.
page
()
.
mainFrame
()
.
findFirstElement
(
'#chat'
)
self
.
composing_timer
=
QTimer
()
self
.
last_message
=
None
...
...
blink/preferences.py
View file @
80f2deb9
...
...
@@ -853,10 +853,11 @@ class PreferencesWindow(base_class, ui_class):
style
=
self
.
style_button
.
itemData
(
self
.
style_button
.
currentIndex
())
style_variant
=
self
.
style_variant_button
.
itemText
(
self
.
style_variant_button
.
currentIndex
())
font_family
=
blink_settings
.
chat_window
.
font
or
style
.
font_family
font_size
=
blink_settings
.
chat_window
.
font_size
or
style
.
font_size
user_icons
=
'show-icons'
if
blink_settings
.
chat_window
.
show_user_icons
else
'hide-icons'
self
.
style_view
.
setChatFont
(
blink_settings
.
chat_window
.
font
or
style
.
font_family
,
blink_settings
.
chat_window
.
font_size
or
style
.
font_size
)
self
.
style_view
.
setHtml
(
self
.
style_view
.
template
.
format
(
base_url
=
FileURL
(
style
.
path
)
+
'/'
,
style_url
=
style_variant
+
'.style'
))
self
.
style_view
.
setHtml
(
self
.
style_view
.
template
.
format
(
base_url
=
FileURL
(
style
.
path
)
+
'/'
,
style_url
=
style_variant
+
'.style'
,
font_family
=
font_family
,
font_size
=
font_size
))
chat_element
=
self
.
style_view
.
page
()
.
mainFrame
()
.
findFirstElement
(
'#chat'
)
chat_element
.
last_message
=
None
...
...
resources/chat/template.html
View file @
80f2deb9
...
...
@@ -17,6 +17,11 @@
<style
id=
"main_style"
type=
"text/css"
media=
"screen,print"
>
@import
url("{style_url}")
;
</style>
<!-- The selected font !-->
<style
id=
"font_style"
type=
"text/css"
media=
"screen,print"
>
body
{
{
font
:
{
font_size
}
px
{
font_family
}
;
}}
</style>
</head>
<body>
<div
id=
"chat"
></div>
...
...
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