Skip to content

Commit

Permalink
Merge branch 'nick/splash-screen'
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzoic committed Apr 4, 2024
2 parents 3dff810 + 0013e23 commit 6b0c55d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions countess/gui/icons/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CountESS icons

* small icons by Nick Moore.

* [Countess Portrait](./countess.gif) by Sayeh Gorjifard.
Binary file added countess/gui/icons/countess.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion countess/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from countess.gui.mini_browser import MiniBrowserFrame
from countess.gui.tabular import TabularDataFrame
from countess.gui.tree import FlippyCanvas, GraphWrapper
from countess.gui.widgets import ask_open_filename, ask_saveas_filename, info_button
from countess.gui.widgets import ask_open_filename, ask_saveas_filename, get_icon, info_button
from countess.utils.pandas import concat_dataframes

# import faulthandler
Expand Down Expand Up @@ -492,6 +492,24 @@ def on_frame_configure(self, event):
self.subframe.place(x=0, y=y, w=event.width, h=event.height - y)


class SplashScreen:

def __init__(self, tk_root):
bg = "skyblue"
self.splash = tk.Toplevel(tk_root, bg=bg)
self.splash.attributes('-type', 'dialog')

font = ("TkHeadingFont", 16, "bold")
tk.Label(self.splash, text=f"CountESS {VERSION}", font=font, bg=bg).grid(padx=10,pady=10)
tk.Label(self.splash, image=get_icon(tk_root, "countess"), bg=bg).grid(padx=10)

self.splash.after(3500, self.destroy)

def destroy(self):
self.splash.destroy()



def make_root():
try:
import ttkthemes # pylint: disable=C0415
Expand Down Expand Up @@ -523,6 +541,7 @@ def make_root():

def main():
root = make_root()
SplashScreen(root)
MainWindow(root, sys.argv[1] if len(sys.argv) > 1 else None)

root.mainloop()
Expand Down
1 change: 1 addition & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</head>
<body>
<div id="toc" class="sidebar">
<img src="{{ site.url }}{{ site.baseurl }}/img/countess.png" width="100%" style="max-width: 16rem;">
<p>
{% if page.url != "/" %}
<a href="{{ site.url }}{{ site.baseurl }}">CountESS Documentation</a></p>
Expand Down
Binary file added docs/img/countess.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b0c55d

Please sign in to comment.