Compact Brush Toggler

Icons for button (self.layout.cmyk_4_lock) :

        self.icon_lock = self.Icon_Lock(self.gray_contrast)
        self.svg_lock_cmyk_4 = QtSvg.QSvgWidget(self.layout.cmyk_4_lock)
        self.svg_lock_cmyk_4.load(self.icon_lock)
    def Icon_Lock(self, hex):
        string = str(
        "<svg width=\"15\" height=\"15\" viewBox=\"0 0 3.9687499 3.9687501\" version=\"1.1\" id=\"svg8\"> \n" +
        "  <defs id=\"defs2\" /> \n" +
        "  <g \n" +
        "     inkscape:label=\"Layer 1\" \n" +
        "     inkscape:groupmode=\"layer\" \n" +
        "     id=\"layer1\"> \n" +
        "    <rect \n" +
        "       style=\"display:inline;opacity:1;fill:"+hex+";fill-opacity:1;stroke-width:1.84699;stroke-dasharray:1.84699, 1.84699\" \n" +
        "       id=\"rect833\" \n" +
        "       width=\"1.8520833\" \n" +
        "       height=\"1.0583333\" \n" +
        "       x=\"1.0583333\" \n" +
        "       y=\"1.8520834\" \n" +
        "       inkscape:label=\"bot\" /> \n" +
        "    <path \n" +
        "       style=\"display:inline;fill:"+hex+";fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\" \n" +
        "       d=\"M 1.3229165,1.8520834 V 1.3229167 L 1.5874998,1.0583334 h 0.79375 L 2.6458331,1.3229167 V 1.8520834 H 2.3812498 l 10e-8,-0.419573 L 2.2716562,1.3229167 H 1.6970938 l -0.1095939,0.1095939 -1e-7,0.4195728 H 1.3229165\" \n" +
        "       id=\"path846\" \n" +
        "       sodipodi:nodetypes=\"ccccccccccccc\" \n" +
        "       inkscape:label=\"top\" /> \n" +
        "  </g> \n" +
        "</svg>"
        )
        array = bytearray(string, encoding='utf-8')
        return array

But yeah QtSvg module so people will have issues because Linux version if not an app image they can’t read it.

1 Like

Thank you, for this and ill take note of the issue. :slight_smile:

as for the brush tip rotation by keyboard ; its fix. Thank you for the help. Talking to you help me get things more clearly. ^-^

@tachiko @LunarKreatures

I just want to ask if you are experiencing a sudden brush resetting to 100 when a toggle is set?
Specially for brushes with predefined brush tip?

yes I am, i notice it when I use shift increase brush size then when toggle off then back on, the size changes back but its weird because the brush size indicator still shows like where I increased it to prior to toggling

I merge a fix for it, yesterday.
Can you try it, if it solves the issue?

For reason something stop working and i didnt notice it until was investigating rotation.

I have a buggy version of krita I think. I need to reinstall because I encounter other bugs that probably shouldnt occur.
I did try your latest update and was buggy but its probably on my end.
And I was not using your plugin enough to know if it was buggt before either

1 Like

I will double check on my end as well.

I pushed another fix.

You can try it and see if any issue about it occurs again ^-^

From time to time there’s a short time where the brush is force to go back to its actual whenever it gets reset to 100. its blink think. if the toggle is on the side its back before the cursor is in the canvas.


image

Trying to make some icon.

Top Row:
Pressure-Size , Pressure-Opacity, Pressure-Soft, Pressure-Rotation, Pressure-Scatter,
Bottom Row:
Pressure Toggle Off, Pressure-Flow, Pressure-Color Rate, Overlay, Overlay Off.

6 Likes

Change some of them;

I change color-rate and flow, they are easily confuse if someone colorblind and if its in small.

Right now I think the only one with issue at very small size is pressure-size. It can be confuse for pressure-toggle-off. Still studying how to add them to my plugin.

image image

1 Like

Your widget should have something like seticon and you need to give it a QIcon to it or maybe a QPixmap.

1 Like

Thank you, got busy stretch this week and I haven’t look into the code after finalizing my icons.
I’ll try it once I can work on this again. For now I’m pretty happy with my icons, I think they represent their respective function well enough.

image

I kinda made it work with QIcons, the dark icons [#373737] looks nice except for softness.
I followed how Krita Icons are saved which are 22 x 22px svgs in two modes light and dark.

Soak Ink one is a pretty fun icon cause it dunks the brush :joy:

softness needs work, a bit of adjustment to paintmode.

OTH dark theme light icon ver needs alot work.

image

[idk how to work pixmap so i just qicon from file. I think i need a way to know if the theme is dark or light]

1 Like

Love the icons, I feel like you could have the option to hide text and make icons larger and square. Since the Icons are very good on their own. maybe a hover 1 sec to see text toolbox.

1 Like
    def showEvent(self, event):
        # Window
        self.Window_Connect()
    def Window_Connect(self):
        # Window
        self.window = Krita.instance().activeWindow()
        if self.window != None:
            self.window.activeViewChanged.connect(self.View_Changed)
            self.window.themeChanged.connect(self.Theme_Changed)
            self.window.windowClosed.connect(self.Window_Closed)

    def Theme_Changed(self):
        theme = QApplication.palette().color(QPalette.Window).value()
        if theme > 128:
            self.color1 = QColor("#191919")
            self.color2 = QColor("#e5e5e5")
        else:
            self.color1 = QColor("#e5e5e5")
            self.color2 = QColor("#191919")
        self.color_alpha = QColor(0, 0, 0, 0)
1 Like

yes - thats what i want. to have a tall layout or a thin layout with large icon only.

Still need lots to figure out.

Soak Ink is… pretty fun icon if I say so myself :joy:

@EyeOdin
I can’t express my gratitude enough, thank you for always helping me.

1 Like

image

We are getting there :smiley: . figure out to size the icon - with the button.

Just need to do a bit of cleaning and make it figure out whats the proper view ;

  1. Squarish → Icon only + Tool tip
  2. Short Rectangle → 3 letter
  3. Long Rectangle → Full

which just a lil bit more selection and calculations.

2 Likes

Hello,

I have tried this and Theme_change work in toggling the dark and light mode.

if self.window != None:
            self.window.themeChanged.connect(self.Theme_Changed)

I just don’t seem to manage to fire it up when i changed theme if the docker is already open when krita opens. temporarily have it in resize for testing purpose.

This only happens when the docker is already running and showing upon opening.
If I close it and open it again via show hide docker - it works perfectly.

I think in this case the docker shows up before the windows fully loaded.

Other than that thank you :slight_smile:

theme is reacting to 128 so it only changes from light to dark there, but it is being triggered. but in either case place debug messages and see where it is breaking exactly.

1 Like