Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Calculator.app #189

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Update Calculator.app #189

wants to merge 24 commits into from

Conversation

Hierosme
Copy link

@Hierosme Hierosme commented Aug 25, 2023

Fix for #186

@probonopd
Copy link
Member

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.

@Hierosme
Copy link
Author

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

@probonopd
Copy link
Member

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!

@Hierosme
Copy link
Author

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
Copy link
Author

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

@louies0623

This comment was marked as off-topic.

@louies0623
Copy link
Contributor

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

@Hierosme
Copy link
Author

Hierosme commented Sep 1, 2023

@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
Copy link
Author

Hierosme commented Sep 1, 2023

Here the QDesigner version
image

soon i'll push

@louies0623
Copy link
Contributor

louies0623 commented Sep 2, 2023

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

@Hierosme
Copy link
Author

Hierosme commented Sep 2, 2023

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...

@louies0623
Copy link
Contributor

louies0623 commented Sep 2, 2023

Html Web colors
Tested by myself on Illustrator.

@Hierosme
Copy link
Author

Hierosme commented Sep 2, 2023

You speack about that ?

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

image

@louies0623
Copy link
Contributor

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

@Hierosme
Copy link
Author

Hierosme commented Sep 2, 2023

Here we are !

image

@louies0623
Copy link
Contributor

louies0623 commented Sep 2, 2023

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

@louies0623

This comment was marked as duplicate.

@probonopd
Copy link
Member

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

@Hierosme
Copy link
Author

Hierosme commented Sep 2, 2023

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 ?

@probonopd
Copy link
Member

probonopd commented Sep 2, 2023

For inspiration:

image

@louies0623
Copy link
Contributor

@Hierosme
Copy link
Author

Hierosme commented Sep 2, 2023

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

@louies0623
Copy link
Contributor

louies0623 commented Sep 5, 2023

Beautiful
Only "M-" is left and changed to "M—"
2nd to 2ⁿᵈ
Done 🎊

@Hierosme
Copy link
Author

Hierosme commented Sep 5, 2023

Done
image

In fact it exist a Minus sign https://www.utf8icons.com/character/8722/minus-sign

@louies0623

This comment was marked as outdated.

@louies0623
Copy link
Contributor

Maybe it can be merged to start testing, and the rest of the functions will be merged later.

@Hierosme
Copy link
Author

Hierosme commented Sep 6, 2023

I add functions one by one.

For each one i have to understand what that is suppose to do, and implement it.
By luck that is generally a pure usage of python math module.

test and repport issue is really important for it type of application.

I'll do my best , i have look calculator for fun when restart to work for helloSystem after my vacations. Soon i'll back to Date and Time.app and the famous sudo loop.

About Merge code:
Keep Pull Request open for years have no True technical raison.
That is in general due from a lake of something like automatized tests, automatized execution tests , automatized regression tests (etc...)
That is the easy way . Where clearlly that is more easy to block Merge Request.
First unfortunally Test have to be done each time a merge request have to be done.
Second Unfortunally it have huge impact, because a eventual contributor have to plan years of work just for fixe a cosmetic thing.

Personally i sugest to Merge the code, Freeze the code before a Release, etc ... common app life circle...

Briefffff everything commun application life circle can be apply.
That is imposible to grow up with a code freezed . My point of view have no importance, code developpement is like that...

@Hierosme
Copy link
Author

Hierosme commented Sep 6, 2023

https://en.wikipedia.org/wiki/Software_development_process

@louies0623
Copy link
Contributor

louies0623 commented Sep 6, 2023

Have a good rest. I have a strong feeling that this "Date and Time.app" must be rebuilt and requires more physical effort.

The main problems at present are the time display problem in the upper left corner and the lame design of removing unnecessary mandatory language and time zone links.

@probonopd
Copy link
Member

probonopd commented Sep 6, 2023

Wow, this is really doing a lot already.

Are "Page Setup", "Print Paper Tape", "RPN" and "Precision" currently doing anything? If not, I suggest to set them to disabled for now.

I like the idea of calling it a "paper tape". Maybe (later) we can even add some cool animation of "paper" coming out from from behind the main window at the top or something like that...

@louies0623
Copy link
Contributor

Maybe (later) we can even add some cool animation of "paper" coming out from from behind the main window at the top or something like that...

I don't recommend this...
image

@Hierosme
Copy link
Author

Hierosme commented Sep 6, 2023

Paper Tape got on the left of the Calculator when show
Disable: "Page Setup", "Print Paper Tape", "RPN" and "Precision", "every unimplemented function in scientific layout"

image

@Hierosme
Copy link
Author

Hierosme commented Sep 6, 2023

It look like i can swith back to Date and Time.app, the code should be merged and a issue open (With Need Contributor Tag) about implement rest of funtions of the scientific layout.

that can be a good task for a new contributor

@louies0623

This comment was marked as outdated.

@louies0623
Copy link
Contributor

louies0623 commented Sep 7, 2023

Why are the characters "ⁿᵈ" not aligned?

@Hierosme
Copy link
Author

Hierosme commented Sep 7, 2023

Why are the characters "ⁿᵈ" not aligned?

You have send me the exact right char: Superscript Latin Small Letter N.
https://www.compart.com/en/unicode/U+207F

That is a Superscript then it is align like a Superscript.
https://en.wikipedia.org/wiki/Subscript_and_superscript

That exactlly the right char...
That char do not exist in center alignement, and the subscript version do not exist yet too ...

@probonopd
Copy link
Member

Do you think this is ready for merge @Hierosme?
Thanks

@Hierosme
Copy link
Author

Yes the code can be merged.

An issue should be open in for asking new contributor assistence for implemente more feature on the scientific layout.
If considerif default basic layout everything is normal.

@probonopd
Copy link
Member

Which features do you see as missing? Maybe we should put them into the notes/comments somewhere so that people know what to hack on ;)

@louies0623
Copy link
Contributor

louies0623 commented Sep 25, 2023

One thing I just thought about recently, maybe I talked about it too late, is why our buttons should be generated with code instead of using png or svg image, like this example.
uidesignkit20

@Hierosme
Copy link
Author

Which features do you see as missing? Maybe we should put them into the notes/comments somewhere so that people know what to hack on ;)

Actully they options are disable:

  • Rad
  • EE
  • RN
  • 2ⁿᵈ
  • n
  • In
  • x!
  • ˣ√𝑦
  • %

by the code:

            if btnText in ["Rad", "EE", "RN", "eˣ", "2ⁿᵈ", "n", "yˣ", "In", "x!", "ˣ√𝑦", "√", "%"]:
                self.scientific_buttons[btnText].setEnabled(False)

That because that it is unimplemented

the task is not really hard, but that a work should be done button by button.
A trap is hide on it task, a dialog should pop and ask value to the user, then got a ping/pong with dialogs (not implemented)

@Hierosme
Copy link
Author

One thing I just thought about recently, maybe I talked about it too late, is why our buttons should be generated with code instead of using png or svg image, like this example. uidesignkit20

That workarround it permit to not use the default theme. The default theme force a hight min/max size on the Button Default class.

The workarround is to not use DefaultButton class, then not permit to the defautl theme to apply the theme to the button.

The goal is to have Elastic GUI effect , and be more speed as possible. Lod a tonne of PNG/SVG is really slow for the init phase. Here the calculator is speed and not burn memory.

I have a code style really aggressive if consedering power usage. Naturally i have choise to create a class for our custum button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants