Giter VIP home page Giter VIP logo

Comments (25)

rdbende avatar rdbende commented on May 23, 2024 2

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.

rdbende avatar rdbende commented on May 23, 2024 2
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()

image

from tukaan.

rdbende avatar rdbende commented on May 23, 2024 1

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.

rdbende avatar rdbende commented on May 23, 2024 1

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.

rdbende avatar rdbende commented on May 23, 2024 1

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.

Moosems avatar Moosems commented on May 23, 2024

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.

sumeshir26 avatar sumeshir26 commented on May 23, 2024

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.

sumeshir26 avatar sumeshir26 commented on May 23, 2024

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.

rdbende avatar rdbende commented on May 23, 2024

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.

sumeshir26 avatar sumeshir26 commented on May 23, 2024

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.

rdbende avatar rdbende commented on May 23, 2024

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.

Moosems avatar Moosems commented on May 23, 2024

What do you mean by dynamic styling?

from tukaan.

Moosems avatar Moosems commented on May 23, 2024

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.

rdbende avatar rdbende commented on May 23, 2024

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.

sumeshir26 avatar sumeshir26 commented on May 23, 2024

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.

alejandroautalan avatar alejandroautalan commented on May 23, 2024

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.

Moosems avatar Moosems commented on May 23, 2024

What does the canvas look like currently?

from tukaan.

Moosems avatar Moosems commented on May 23, 2024

Can you break down what path is?

from tukaan.

Moosems avatar Moosems commented on May 23, 2024

I have a feeling that this will need a very in depth segment of documentation

from tukaan.

rdbende avatar rdbende commented on May 23, 2024

https://tukaan.github.io/docs/themes/themes

from tukaan.

sumeshir26 avatar sumeshir26 commented on May 23, 2024

https://tukaan.github.io/docs/themes/themes

Theres nothing over there...
image

from tukaan.

rdbende avatar rdbende commented on May 23, 2024

Yes, I know. That's why we need to fill it in 🙃

from tukaan.

rdbende avatar rdbende commented on May 23, 2024

But wait, is that little thingy under the "Docs" label actually dark blue?

from tukaan.

sumeshir26 avatar sumeshir26 commented on May 23, 2024

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.

rdbende avatar rdbende commented on May 23, 2024

No - its light blue...
(At least if i check now)

👍

from tukaan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.