Skip to content

Commit

Permalink
Updated Background color
Browse files Browse the repository at this point in the history
Signed-off-by: arunsivaramanneo <[email protected]>
  • Loading branch information
arunsivaramanneo committed Oct 24, 2017
1 parent 0b940cc commit 54c47a3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 24 deletions.
10 changes: 4 additions & 6 deletions Files/About.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
import Const
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk
from Common import setBackgroundColor, createScrollbar
from Common import setBackgroundColor, createScrollbar, setColumns

Title1 = ["About GPU Viewer v1.1"]
Title2 = ["Change Log"]


def about(tab3):
grid = Gtk.Grid()
tab3.add(grid)
frame1 = Gtk.Frame(label="")
grid.add(frame1)
tab3.add(frame1)
frame2 = Gtk.Frame(label="")
grid.attach_next_to(frame2, frame1, Gtk.PositionType.BOTTOM, 1, 1)
tab3.add(frame2)
screen = Gdk.Screen.get_default()
About_list = Gtk.ListStore(str, str)
i = 0
Expand All @@ -25,7 +23,7 @@ def about(tab3):
i = i + 1

TreeAbout = Gtk.TreeView(About_list, expand=True)
wrapWidth = screen.get_width() * 0.5
wrapWidth = screen.get_width() * 0.58

for i, column_title in enumerate(Title1):
renderer1 = Gtk.CellRendererText(font=Const.FONT)
Expand Down
3 changes: 2 additions & 1 deletion Files/Common.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ def createSubTab(Tab, notebook, label):


# Setting Columns in TreeView
def setColumns(Treeview, Title, MWIDTH):
def setColumns(Treeview, Title, MWIDTH,align):
for i, column_title in enumerate(Title):
renderer = Gtk.CellRendererText(font=Const.FONT)
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
column.set_sort_column_id(i)
column.set_alignment(align)
column.add_attribute(renderer, "background", len(Title))
column.set_property("min-width", MWIDTH)
Treeview.append_column(column)
Expand Down
2 changes: 1 addition & 1 deletion Files/Const.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

BGCOLOR1 = "#fff"

BGCOLOR2 = "#ddd"
BGCOLOR2 = "#eee"

BGCOLOR3 = "#bbb"

Expand Down
10 changes: 5 additions & 5 deletions Files/OpenGLViewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
WH = 70

Title1 = [" "]
Title2 = [" ", " "]
Title2 = ["OpenGL Information ", " Details"]
LimitsTitle = ["OpenGL Hardware Limits", "Value"]


Expand All @@ -22,7 +22,7 @@ def OpenGL(tab1):
tab1.add(grid)
grid4 = Gtk.Grid()
grid4.set_row_spacing(10)
frame1 = Gtk.Frame(label="OpenGL_Information", expand=True)
frame1 = Gtk.Frame(label="", expand=True)
grid.attach(frame1, 0, 0, 12, 1)
frame1.add(grid4)
OpenGLInfo_list = Gtk.ListStore(str, str, str)
Expand All @@ -43,7 +43,7 @@ def OpenGL(tab1):

TreeGL = Gtk.TreeView(OpenGLInfo_list, expand=True)
# TreeGL.set_enable_search(True)
setColumns(TreeGL, Title2, Const.MWIDTH)
setColumns(TreeGL, Title2, Const.MWIDTH,0.0)

scrollable_treelist = createScrollbar(TreeGL)
grid4.add(scrollable_treelist)
Expand Down Expand Up @@ -86,7 +86,7 @@ def clickme(button):
Limits_Store.append([line.strip('\n'), LimitsRHS[i].strip('\n'), background_color])
i = i + 1

setColumns(TreeLimits, LimitsTitle, Const.MWIDTH)
setColumns(TreeLimits, LimitsTitle, Const.MWIDTH,0.0)
LimitsScrollbar = createScrollbar(TreeLimits)
LimitsFrame.add(LimitsScrollbar)

Expand Down Expand Up @@ -264,7 +264,7 @@ def radcall(button, value):
grid1.attach_next_to(Vendor_Combo, OpenGLRad, Gtk.PositionType.BOTTOM, 5, 1)
TreeGLExt.set_enable_search(True)
TreeGLExt.set_headers_visible(True)
setColumns(TreeGLExt, Title1, Const.MWIDTH)
setColumns(TreeGLExt, Title1, Const.MWIDTH,0.0)

grid.attach(frame4, 0, 3, 12, 1)
grid3 = Gtk.Grid()
Expand Down
17 changes: 6 additions & 11 deletions Files/VulkanViewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def radcall(combo):
DeviceTab_Store = Gtk.ListStore(str, str, str)
TreeDevice = Gtk.TreeView(DeviceTab_Store, expand=True)

setColumns(TreeDevice, DeviceTitle, Const.MWIDTH)
setColumns(TreeDevice, DeviceTitle, Const.MWIDTH,0.0)

DeviceScrollbar = createScrollbar(TreeDevice)
DeviceGrid.add(DeviceScrollbar)
Expand Down Expand Up @@ -606,7 +606,7 @@ def radcall(combo):
TreeLimits = Gtk.TreeView(LimitsTab_Store, expand=True)
TreeLimits.set_enable_search(True)

setColumns(TreeLimits, LimitsTitle, Const.MWIDTH)
setColumns(TreeLimits, LimitsTitle, Const.MWIDTH,0.0)

LimitsScrollbar = createScrollbar(TreeLimits)
LimitsGrid.add(LimitsScrollbar)
Expand All @@ -620,7 +620,7 @@ def radcall(combo):
TreeExtension = Gtk.TreeView(ExtensionTab_Store, expand=True)
TreeExtension.set_enable_search(True)

setColumns(TreeExtension, ExtensionsTitle, Const.MWIDTH)
setColumns(TreeExtension, ExtensionsTitle, Const.MWIDTH,0.0)

ExtensionScrollbar = createScrollbar(TreeExtension)
ExtensionGrid.add(ExtensionScrollbar)
Expand Down Expand Up @@ -726,7 +726,7 @@ def radcall(combo):
TreeInstance = Gtk.TreeView(InstanceTab_Store, expand=True)
TreeInstance.set_enable_search(True)

setColumns(TreeInstance, InstanceTitle, 300)
setColumns(TreeInstance, InstanceTitle, 300,0.0)

InstanceScrollbar = createScrollbar(TreeInstance)
InstanceGrid.add(InstanceScrollbar)
Expand All @@ -737,7 +737,7 @@ def radcall(combo):
TreeLayer = Gtk.TreeView(LayerTab_Store, expand=True)
TreeLayer.set_enable_search(TreeLayer)

setColumns(TreeLayer, LayerTitle, 100)
setColumns(TreeLayer, LayerTitle, 100,0.0)

LayerScrollbar = createScrollbar(TreeLayer)
LayerGrid.add(LayerScrollbar)
Expand Down Expand Up @@ -771,11 +771,7 @@ def radcall(combo):
grid.set_row_spacing(30)
os.system("cat /tmp/vulkaninfo.txt | grep Name | grep -o =.* | grep -o ' .*' > /tmp/GPU.txt")

with open("/tmp/GPU.txt", "r") as file2:
list = []
file2.seek(0, 0)
for line in file2:
list.append(line)
list = copyContentsFromFile("/tmp/GPU.txt")

list = [i.strip('\n ') for i in list]

Expand All @@ -784,7 +780,6 @@ def radcall(combo):
DevicesGrid.attach(DS, 0, 1, 1, 1)
gpu_store = Gtk.ListStore(str)
for i in list:
# print(i)
gpu_store.append([i])

gpu_combo = Gtk.ComboBox.new_with_model(gpu_store)
Expand Down

0 comments on commit 54c47a3

Please sign in to comment.