Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
b6481d54
Commit
b6481d54
authored
15 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
[Jonathan Michalon] Make latex images theme aware.
parent
4e4a91db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/latex.py
+7
-1
7 additions, 1 deletion
src/common/latex.py
src/gajim.py
+19
-0
19 additions, 0 deletions
src/gajim.py
with
26 additions
and
1 deletion
src/common/latex.py
+
7
−
1
View file @
b6481d54
...
...
@@ -114,6 +114,12 @@ def latex_to_image(str_):
result
=
None
exitcode
=
0
try
:
bg_str
,
fg_str
=
gajim
.
interface
.
get_bg_fg_colors
()
except
:
# interface may not be available when we test latext at startup
bg_str
,
fg_str
=
'
rgb 1.0 1.0 1.0
'
,
'
rgb 0.0 0.0 0.0
'
# filter latex code with bad commands
if
check_blacklist
(
str_
):
# we triggered the blacklist, immediately return None
...
...
@@ -131,7 +137,7 @@ def latex_to_image(str_):
if
exitcode
==
0
:
# convert dvi to png
latex_png_dpi
=
gajim
.
config
.
get
(
'
latex_png_dpi
'
)
exitcode
=
try_run
([
'
dvipng
'
,
'
-bg
'
,
'
rgb 1.0 1.0 1.0
'
,
'
-T
'
,
exitcode
=
try_run
([
'
dvipng
'
,
'
-bg
'
,
bg_str
,
'
-fg
'
,
fg_str
,
'
-T
'
,
'
tight
'
,
'
-D
'
,
latex_png_dpi
,
tmpfile
+
'
.dvi
'
,
'
-o
'
,
tmpfile
+
'
.png
'
])
...
...
This diff is collapsed.
Click to expand it.
src/gajim.py
+
19
−
0
View file @
b6481d54
...
...
@@ -3036,6 +3036,25 @@ class Interface:
pep
.
user_send_tune
(
acct
,
artist
,
title
,
source
)
gajim
.
connections
[
acct
].
music_track_info
=
music_track_info
def
get_bg_fg_colors
(
self
):
def
gdkcolor_to_rgb
(
gdkcolor
):
return
[
c
/
65535.
for
c
in
(
gdkcolor
.
red
,
gdkcolor
.
green
,
gdkcolor
.
blue
)]
def
format_rgb
(
r
,
g
,
b
):
return
'
'
.
join
([
str
(
c
)
for
c
in
(
'
rgb
'
,
r
,
g
,
b
)])
def
format_gdkcolor
(
gdkcolor
):
return
format_rgb
(
*
gdkcolor_to_rgb
(
gdkcolor
))
# get style colors and create string for dvipng
dummy
=
gtk
.
Invisible
()
dummy
.
ensure_style
()
style
=
dummy
.
get_style
()
bg_str
=
format_gdkcolor
(
style
.
base
[
gtk
.
STATE_NORMAL
])
fg_str
=
format_gdkcolor
(
style
.
text
[
gtk
.
STATE_NORMAL
])
return
(
bg_str
,
fg_str
)
def
read_sleepy
(
self
):
'''
Check idle status and change that status if needed
'''
if
not
self
.
sleeper
.
poll
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment