Comments (25)
Yup, it's not yet complete. But basically it just uses the TkPath project (an alternative canvas widget that uses native backends for drawing), instead of Tk's original canvas widget. So actually it's not the original canvas that's been improved, but it's an alternative implementation.
I'm also working on a wrapper around the TkPath
canvas widget for Tkinter.
from tukaan.
import tukaan
from tukaan.gfx import Brush, Canvas, Gradient, Pen, Transform
app = tukaan.App()
c = Canvas(app)
c.grid()
rect = Canvas.Rect(
c,
30,
30,
80,
80,
border_radius=10,
brush=Brush(fill=Gradient.Linear(["#cc00ff", "#007fff"])),
pen=Pen(color="#fff", opacity=0.7, width=2),
)
path = Canvas.Path(
c,
draw="M 50 50 C 50 100, 50 100, 100 50",
pen=Pen(color="#aaffaa", width=4, line_cap="round"),
)
rect.transform(Transform.Scale(1.3) @ Transform.TranslateX(-10))
app.run()
from tukaan.
When you do this:
.button {
color: #fafafa;
background-color: #6667ab;
padding: 4px 8px;
border-radius: 4px;
}
Tukaan can't generate widget styles based on information like this.
from tukaan.
They do support antialiasing on every platform! 🤔
Just take a look at one of my themes, they are all antialiased.
Tk supports displaying antialiased images, and since most ttk theme are mafe of pixmap, they look good even on Windows. The only thing in Tk that doesn't support antialiasing on Linux and Windows is the Canvas
widget, but (of course :) Tukaan has a alternative canvas implementation, that has everything you can imagine.
from tukaan.
Path is an SVG element originally. Basically it's a very powerful pen element with which you can draw lines, curves, arcs, and more.
Documentation: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths
from tukaan.
Can we add the sun-valley ttk theme as a built-in theme? Question: can we still allow the user to choose button width/height and font even when using a special theme (something tkinter does not allow)?
from tukaan.
Can we add the sun-valley ttk theme as a built-in theme? Question: can we still allow the user to choose button width/height and font even when using a special theme (something tkinter does not allow)?
@rdbende said he was going to make a extension for Tukkan with many themes
from tukaan.
So, if I have a Windows 11 GTK/KDE theme, will the app match that theme, or does GTTK only work with system themes?
Sorry this is a stupid question, but I don't have Linux so I was curious.
from tukaan.
Gttk can use any Gtk theme that is installed on the system, provided that the theme has a Gtk 2.0 version. So if it's Gtk 3 only (which uses CSS for styling), it won't be able to use it.
On KDE Plasma (which is based on Qt) it can't use the widget styles, instead it will use the buil-in clam theme, and apply the system colorscheme to it
from tukaan.
Gttk can use any Gtk theme that is installed on the system, provided that the theme has a Gtk 2.0 version. So if it's Gtk 3 only (which uses CSS for styling), it won't be able to use it. On KDE Plasma (which is based on Qt) it can't use the widget styles, instead it will use the buil-in clam theme, and apply the system colorscheme to it
I thought Tukaan also supports CSS theming?
from tukaan.
Yes, but the Tukaan css theming is a bit different than Gtk.
In Tukaan you have to use png images, just as in Tkinter, but the css syntax makes it much easier to set the other properties, however it doesn't support dynamic styling.
from tukaan.
What do you mean by dynamic styling?
from tukaan.
I could create a lexer for it. We could also have it use a png generator that bases it off of a built in design and modify it to specifications. It would be a bit of work but could be done
from tukaan.
Yupp, that was my first idea when I started with ttk themes. But then it became "just" the Azure theme, because I realized how much work it would be just to build a CSS parser and generate Tcl scripts from it. However, if I'm actually halfway done with that whole thing in Tukaan, why not make a png generator too? (I believe, PIL.ImageDraw doesn't support antialiasing, so it wouldn't be suitable for this purpose.)
from tukaan.
omg that would be soo cool! But tkk buttons dont support antialiasing on Windows at least, so whats the ppoint of making a antialiased lexer?
from tukaan.
Hello,
Tukaan has a alternative canvas implementation, that has everything you can imagine.
I am interested in the implementation of the canvas and its improvements. It's not released yet right?
from tukaan.
What does the canvas look like currently?
from tukaan.
Can you break down what path is?
from tukaan.
I have a feeling that this will need a very in depth segment of documentation
from tukaan.
https://tukaan.github.io/docs/themes/themes
from tukaan.
from tukaan.
Yes, I know. That's why we need to fill it in 🙃
from tukaan.
But wait, is that little thingy under the "Docs" label actually dark blue?
from tukaan.
But wait, is that little thingy under the "Docs" label actually dark blue?
No - its light blue...
(At least if i check now)
from tukaan.
No - its light blue...
(At least if i check now)
👍
from tukaan.
Related Issues (20)
- Upload to pypi soon HOT 3
- `ButtonGroup` widget
- `LabeledView` widget
- Add DBus API HOT 1
- There are too many files HOT 1
- `tkinter` widget support HOT 3
- Add a better color module HOT 2
- Docstrings explaining widget HOT 3
- Make Combobox and Spinbox generic HOT 5
- Window not shown HOT 5
- Make `main` branch the main HOT 3
- How can I apply mica effect to the tukaan window? HOT 1
- `.size()` method crashes application HOT 2
- KolorScheme on Mac breaks tooltips HOT 2
- Delay first update until `run()` HOT 1
- Builtin required size getters
- `enabled` property on `Tab` doesn't work
- `TabView` makes some binds that are never saved HOT 1
- `TabView.enable_tab_dragging()` is broken
- Tooltip delay argument HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tukaan.