Skip to content

Commit

Permalink
added logos to about tab
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtedde committed Sep 30, 2023
1 parent caf9502 commit b8ef1bd
Show file tree
Hide file tree
Showing 5 changed files with 640 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/vorta/assets/UI/abouttab.ui
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@
<property name="topMargin">
<number>10</number>
</property>
<property name="bottomMargin">
<number>10</number>
</property>
<item>
<widget class="QLabel" name="borgPath">
<property name="text">
Expand All @@ -186,6 +189,45 @@
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="seperator">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="topMargin">
<number>10</number>
</property>
<property name="bottomMargin">
<number>10</number>
</property>
<property name="spacing">
<number>20</number>
</property>
<item>
<widget class="QLabel" name="gpl_logo"/>
</item>
<item>
<widget class="QLabel" name="python_logo"/>
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="seperator">
<property name="frameShape">
<enum>QFrame::HLine</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down
315 changes: 315 additions & 0 deletions src/vorta/assets/icons/gpl_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
265 changes: 265 additions & 0 deletions src/vorta/assets/icons/python_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/vorta/views/about_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from vorta._version import __version__
from vorta.store.models import BackupProfileMixin
from vorta.utils import get_asset
from vorta.views.utils import get_colored_pixmap

uifile = get_asset('UI/abouttab.ui')
AboutTabUI, AboutTabBase = uic.loadUiType(uifile)
Expand All @@ -26,6 +27,9 @@ def __init__(self, parent=None):
'underline; color:#0984e3;">Click here</span></a> to view the logs.'
)

self.gpl_logo.setPixmap(get_colored_pixmap('gpl_logo', 40))
self.python_logo.setPixmap(get_colored_pixmap('python_logo', 40))

def set_borg_details(self, version, path):
self.borgVersion.setText(version)
self.borgPath.setText(f"<center>Path to Borg:<br>{path}</center>")
14 changes: 14 additions & 0 deletions src/vorta/views/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,17 @@ def get_colored_icon(icon_name):
svg_img = QImage.fromData(svg_str).scaledToHeight(128)

return QIcon(QPixmap(svg_img))


def get_colored_pixmap(icon_name, scaled_height):
"""
Return SVG icon in the correct color.
"""
with open(get_asset(f"icons/{icon_name}.svg"), 'rb') as svg_file:
svg_str = svg_file.read()
if uses_dark_mode():
svg_str = svg_str.replace(b'#000000', b'#ffffff')
# Reduce image size to specified scaled height
svg_img = QImage.fromData(svg_str).scaledToHeight(scaled_height)

return QPixmap(svg_img)

0 comments on commit b8ef1bd

Please sign in to comment.