Skip to content

Commit

Permalink
Fix background color
Browse files Browse the repository at this point in the history
Ref. #345
  • Loading branch information
Alexander Senier authored and treiher committed Jul 29, 2020
1 parent b8157be commit 92fa871
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions ide/gnatstudio/recordflux.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import re

from gi.repository import Gtk
from gi.repository import Gdk, Gtk

import GPS
import highlighter.common as hl
Expand Down Expand Up @@ -367,9 +367,11 @@ def display_message_graph(filename):
if not message_name:
print("No message found under cursor")
return

scrolled_window = Gtk.ScrolledWindow()
scrolled_window.set_border_width(10)
scrolled_window.set_border_width(0)
scrolled_window.set_policy(Gtk.PolicyType.ALWAYS, Gtk.PolicyType.ALWAYS)
scrolled_window.override_background_color(Gtk.StateType.NORMAL, Gdk.RGBA())
graph = Gtk.Image()
graph.set_from_file(output_dir() + "/" + message_name + ".svg")
scrolled_window.add_with_viewport(graph)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_empty_message_graph() -> None:
m = Message("P.M", [], {})
expected = """
digraph "P.M" {
graph [ranksep="0.8 equally", splines=ortho];
graph [bgcolor="#00000000", pad="0.5", ranksep="0.8 equally", splines=ortho, truecolor=true];
edge [color="#6f6f6f", fontcolor="#6f6f6f", fontname="Fira Code"];
node [color="#6f6f6f", fillcolor="#009641", fontcolor="#ffffff", fontname=Arimo,
shape=box, style="rounded,filled", width="1.5"];
Expand All @@ -63,7 +63,7 @@ def test_dot_graph() -> None:
)
expected = """
digraph "P.M" {
graph [ranksep="0.8 equally", splines=ortho];
graph [bgcolor="#00000000", pad="0.5", ranksep="0.8 equally", splines=ortho, truecolor=true];
edge [color="#6f6f6f", fontcolor="#6f6f6f", fontname="Fira Code"];
node [color="#6f6f6f", fillcolor="#009641", fontcolor="#ffffff", fontname=Arimo,
shape=box, style="rounded,filled", width="1.5"];
Expand All @@ -90,7 +90,7 @@ def test_dot_graph_with_condition() -> None:
)
expected = """
digraph "P.M" {
graph [ranksep="0.8 equally", splines=ortho];
graph [bgcolor="#00000000", pad="0.5", ranksep="0.8 equally", splines=ortho, truecolor=true];
edge [color="#6f6f6f", fontcolor="#6f6f6f", fontname="Fira Code"];
node [color="#6f6f6f", fillcolor="#009641", fontcolor="#ffffff", fontname=Arimo,
shape=box, style="rounded,filled", width="1.5"];
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_dot_graph_with_double_edge() -> None:
)
expected = """
digraph "P.M" {
graph [ranksep="0.8 equally", splines=ortho];
graph [bgcolor="#00000000", pad="0.5", ranksep="0.8 equally", splines=ortho, truecolor=true];
edge [color="#6f6f6f", fontcolor="#6f6f6f", fontname="Fira Code"];
node [color="#6f6f6f", fillcolor="#009641", fontcolor="#ffffff", fontname=Arimo,
shape=box, style="rounded,filled", width="1.5"];
Expand Down

0 comments on commit 92fa871

Please sign in to comment.