Skip to content

Commit

Permalink
Merge adapta into master for Adapta theme (PR #72)
Browse files Browse the repository at this point in the history
  • Loading branch information
RedFantom authored Nov 18, 2020
2 parents cbbf8d4 + ada43d8 commit 61ff388
Show file tree
Hide file tree
Showing 101 changed files with 597 additions and 22 deletions.
5 changes: 5 additions & 0 deletions docs/themes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ always room for more themes, no matter how ugly or obscure! Even though
some themes may not be used in practice, the original goal of the
project has not been forgotten: To gather and preserve *all* themes.

Adapta
------
|adapta|

Aquativo
--------
|aquativo|
Expand Down Expand Up @@ -133,6 +137,7 @@ Theme derived from the new Ubuntu 20.04 default theme and theme 'arc'.
.. _Fuduntu: https://en.wikipedia.org/wiki/Fuduntu
.. _here: https://www.gnome-look.org/content/show.php/Blue+Elegance+Light?content=164806
.. _equilux: https://github.com/ddnexus/equilux-theme
.. |adapta| image:: https://imgur.com/4O3vbvk.png
.. |aquativo| image:: https://imgur.com/RUH48LL.png
.. |arc| image:: https://imgur.com/nmjPIYl.png
.. |black| image:: https://imgur.com/5vs2aw4.png
Expand Down
23 changes: 13 additions & 10 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
Copyright (c) 2018 RedFantom
"""
import os
import sys
if sys.version_info.major == 3:
import tkinter as tk
from tkinter import ttk
else:
import Tkinter as tk
import ttk
import tkinter as tk
from tkinter import ttk
from ttkthemes import ThemedTk, THEMES
from ttkwidgets import ScaleEntry
from ttkwidgets.autocomplete import AutocompleteCombobox
Expand All @@ -21,9 +16,16 @@ class Example(ThemedTk):
"""
Example that is used to create screenshots for new themes.
"""
def __init__(self):
ThemedTk.__init__(self, themebg=True)
def __init__(self, theme="arc"):
"""
:param theme: Theme to show off
"""
ThemedTk.__init__(self, fonts=True, themebg=True)
self.set_theme(theme)
# Create widgets
self.notebook = ttk.Notebook(self)
self.notebook.add(ttk.Button(self, text="Hello World"), text="Frame One")
self.notebook.add(ttk.Button(self, text="Hello Universe"), text="Frame Two")
self.menu = tk.Menu(self, tearoff=False)
self.sub_menu = tk.Menu(self.menu, tearoff=False)
self.sub_menu.add_command(label="Exit", command=self.destroy)
Expand Down Expand Up @@ -59,6 +61,7 @@ def setup_tree(self):
def grid_widgets(self):
"""Put widgets in the grid"""
sticky = {"sticky": "nswe"}
self.notebook.grid(row=0, column=1, columnspan=2, **sticky)
self.label.grid(row=1, column=1, columnspan=2, **sticky)
self.dropdown.grid(row=2, column=1, **sticky)
self.entry.grid(row=2, column=2, **sticky)
Expand Down Expand Up @@ -100,5 +103,5 @@ def screenshot_themes(self, *args):

if __name__ == '__main__':
example = Example()
example.set_theme("smog")
example.set_theme("adapta")
example.mainloop()
Binary file added screenshots/adapta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions tools/svg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
Author: RedFantom
License: GNU GPLv3
Copyright (c) 2017-2018 RedFantom
Simple script to convert GTK-theme SVG images to PNG images
Depends on inkscape
"""
import os
import subprocess
from ttkthemes._utils import get_themes_directory

print("** SVG to PNG converter **")

theme = input("Theme name: ")
png_path = os.path.join(get_themes_directory(theme, True), theme, theme)
if not os.path.exists(png_path):
print("Please copy the SVG images to {} first.".format(png_path))
exit(-1)

print("Converting SVG images to PNG...", end="", flush=True)
os.chdir(png_path)
for svg_image in os.listdir(os.getcwd()):
if not svg_image.endswith((".svg", ".svg.in")):
continue
png_image = svg_image.replace(".svg", ".png").replace(".in", "")
command = ["inkscape", "-z", "-e", png_image, svg_image]
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.wait()
stdout, stderr = p.communicate()
if len(stderr) != 0 and not b"Format autodetect failed" in stderr:
print("\nSubprocess error: {}".format(stderr))
exit(-2)
print(".", end="", flush=True)
os.remove(svg_image)
print(" Done.")

192 changes: 192 additions & 0 deletions ttkthemes/png/adapta/LICENSE.md

Large diffs are not rendered by default.

Loading

0 comments on commit 61ff388

Please sign in to comment.