Utilities icon indicating copy to clipboard operation
Utilities copied to clipboard

Update Calculator.app

Open Hierosme opened this issue 1 year ago • 53 comments

Fix for #186

Hierosme avatar Aug 25 '23 15:08 Hierosme

Thanks @Hierosme. Can we put the = button in the lower left spot of the grid? Right now it is "in between" which doesn't look orderly.

Also, I think we should try to minimize the width of the window; if we can use a smaller font for the M... buttons we might be able to do something like this:

image

But as far as I remember, the theme is currently hardcoding the font size for buttons, so I need to change that in QtPlugin first.

probonopd avatar Aug 26 '23 07:08 probonopd

Normally button should not be use like that, i certainly migrate to a True custum widget for get the True OsX layout.

Yes the "=" half position is due to the Theme where horizontal scale is allow but the vertical scale force a central position like we have. (It work horizontally for "0")

Here on GNU/Linux default QT theme: image

The trouble is normaly not under the Calculator.app code

Hierosme avatar Aug 26 '23 12:08 Hierosme

Oh you are right, the trouble is that we are forcing all buttons the same height in the theme.

Can you please make the = button align to the bottom, so that at least it doesn't end up in between columns. Thanks!

probonopd avatar Aug 26 '23 12:08 probonopd

If i do it the Vertical Grow Up will be disable.

That is more job , but i can easilly create a custum button class and got it type of result image

image

Hierosme avatar Aug 26 '23 13:08 Hierosme

Just for let you know i have look for create a custum button class, soon a screenshoot i hope ...

Hierosme avatar Aug 30 '23 19:08 Hierosme

It should be calculated like this with the discount "%", which is more convenient because of the needs of life, especially shopping or online auctions. image

louies0623 avatar Aug 31 '23 23:08 louies0623

image I hope there is a paper tape that clearly records whether the numbers I entered are correct.

louies0623 avatar Sep 01 '23 00:09 louies0623

@louies0623 i have create the paper tape dialog last day afternoon :)

in fact i have recreate the Calc interface by use QDesigner.

Here what i code: https://flylib.com/books/en/2.585.1.81/1/

Hierosme avatar Sep 01 '23 06:09 Hierosme

Here the QDesigner version image

soon i'll push

Hierosme avatar Sep 01 '23 16:09 Hierosme

If possible, please change the background color of C to #FF3333, then change the background of = to #FF9933, and finally change the background of the digital display to #CCFFCC and change its text to black #333333. In addition, the background of the dark gray button is changed to gray #777777, probably like this

louies0623 avatar Sep 02 '23 06:09 louies0623

Yes that is possible,

but from where come it color palette ? Have you a document link ?

For Nord -> https://www.nordtheme.com/docs/colors-and-palettes For Dracula -> https://spec.draculatheme.com/

The red color you propose is the same as darcula color palette

The color i use come from OsX color palette...

Hierosme avatar Sep 02 '23 06:09 Hierosme

Html Web colors Tested by myself on Illustrator.

louies0623 avatar Sep 02 '23 07:09 louies0623

You speack about that ?

If not please send a screenshoot of you work for have a better understand of the final result

image

Hierosme avatar Sep 02 '23 07:09 Hierosme

螢幕快照 2023-09-02 下午4 00 26

louies0623 avatar Sep 02 '23 08:09 louies0623

Here we are !

image

Hierosme avatar Sep 02 '23 09:09 Hierosme

The red is a bit too red, make it darker. Then we think of ways to make the buttons realistic. image

louies0623 avatar Sep 02 '23 11:09 louies0623

The red is a bit too red, make it darker.

louies0623 avatar Sep 02 '23 11:09 louies0623

And we certainly don't want "flat design".

probonopd avatar Sep 02 '23 11:09 probonopd

That suppose to load images in the background of each button.

I have 100% control of what is display on the custum button class. but i havent Calculator Buttons asset ready to use ...

Have you graphic any asset i can use ?

Hierosme avatar Sep 02 '23 11:09 Hierosme

For inspiration:

image

probonopd avatar Sep 02 '23 11:09 probonopd

https://freesvg.org/computer-keys-vector-image Maybe this

louies0623 avatar Sep 02 '23 12:09 louies0623

The better is to create our, that not take a tonne of time. I 'll send screenshoot's during my try.

Hierosme avatar Sep 02 '23 13:09 Hierosme

After hours of try, import image and scale to max size is really hard to do.

I have better result by use QPainterPath and Gradient.

image

Hierosme avatar Sep 03 '23 19:09 Hierosme

More rounded image

Hierosme avatar Sep 03 '23 22:09 Hierosme

You can reduce the white transparency gradient to about 60% and it will look much better. Then here is the design of the gradient that I think is pretty good (bottom button). image

louies0623 avatar Sep 04 '23 00:09 louies0623

image

Here the code

        if not self.state_pressed:
            gradient = QLinearGradient(0, 0, 0, self.height() * 4)
            gradient.setColorAt(0.0, Qt.white)
            gradient.setColorAt(0.06, self.color())
            gradient.setColorAt(0.7, Qt.black)
        else:
            gradient = QLinearGradient(0, 0, 0, self.height() * 4)
            gradient.setColorAt(0.0, Qt.gray)
            gradient.setColorAt(0.06, self.color())
            gradient.setColorAt(0.7, Qt.black)

        # Set painter colors to given values.
        pen = QPen(self.outlineColor, self.bordersize)
        painter.setPen(pen)
        painter.setBrush(gradient)

Hierosme avatar Sep 04 '23 07:09 Hierosme

Basic Layout image

Scientific Layout image

Yes it can controle the size ...

Hierosme avatar Sep 04 '23 14:09 Hierosme

But look at me thaat cosine of 42 !!!

image

@louies0623 If you have color suggess for scientific layout. What about the Display gradient ?

Hierosme avatar Sep 04 '23 22:09 Hierosme

C-SVG SVG file

louies0623 avatar Sep 04 '23 23:09 louies0623

265548076-d4643972-a195-4e14-b743-5d64c54162ac It would be better to change it to dark gray.

louies0623 avatar Sep 05 '23 11:09 louies0623