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

Configurable text on labelled widgets #377

Closed
jarvisteach opened this Issue Feb 14, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@jarvisteach
Owner

jarvisteach commented Feb 14, 2018

When adding a labelled widget, it should be possible to set the text, rather than using the title.

@jarvisteach jarvisteach added this to the 1.0 milestone Feb 14, 2018

jarvisteach added a commit that referenced this issue Feb 14, 2018

_getLabelBox can now receive a label parameter #377
Now possible (internally) to set text for label boxes
@jarvisteach

This comment has been minimized.

Owner

jarvisteach commented Feb 14, 2018

This feature is used in all these places:

  • .addLabelEntry(title)
  • .addLabelNumericEntry(title)
  • .addLabelSecretEntry(title)
  • .addSecretLabelEntry(title)
  • .addLabelAutoEntry(title, words)
  • .addLabelFileEntry(title)
  • .addLabelDirectoryEntry(title)
  • .addLabelValidationEntry(title)
  • .addLabelNumericEntry(title)
  • .addNumericLabelEntry(title)
  • .addLabelScale(title)
  • .addLabelOptionBox(title, values)
  • .addLabelTickOptionBox(title, values)
  • .addLabelSpinBox(title, values)
  • .addLabelSpinBoxRange(title, from, to)

Will need a bit of refactoring to allow them all to support it.

@mpmc

This comment has been minimized.

Contributor

mpmc commented Feb 14, 2018

I was actually going to open an issue about this!

Right now I'm unpacking..

        no_devices = {
            'title': '{}'.format(_('\u2639 No devices were found on '
                                   'your network.\nCheck your '
                                   'firewall, and/or reboot your '
                                   'device, then re-scan. \u261B')),
            'pos': (0, 0),
            'sticky': 'nesw',
        }

Where with the others that use a separate title, value, I'm doing..

        device_list = {
            'title': 'addr',
            'value': result,
            'pos': (0, 0),
            'sticky': 'nesw',
        }

Don't forget label frames, they too only support title, but no value 👍

Oh, almost forgot. I would also change method keywords "values" to just "value", so it's consistent, and explain in the docs that the value keyword can accept multiple values (where appropriate) .

@jarvisteach

This comment has been minimized.

Owner

jarvisteach commented Feb 14, 2018

A bit of inconsistency has crept in across a number of areas in terms of parameter naming:

  • title - generally the ID used to store the widget
  • name - the text displayed in a widget (when configurable)
  • label - the text shown in labels for widgets, and sometimes to set a name as above
  • value - usually the data to display in the widget

ListBoxes, SpinBoxes & Properties take a values parameter instead of value
OptionBoxes take an options parameter
And other widgets have specifically named parameters

I think there's a job to be done here in terms of making them consistent, which will unfortunately break some people's code - perfect for the 1.0 release :)

Oh, and BTW - you can (now?) set the text on LabelFrames with the name parameter...

@mpmc

This comment has been minimized.

Contributor

mpmc commented Feb 14, 2018

I would keep, title (or maybe name is better, as it's the name of the widget?), value, and label. All the rest where they differ (options, values etc) could be replaced with value?

jarvisteach added a commit that referenced this issue Feb 17, 2018

Updated to labelled widgets #377
_getLabelBox now sets a label & font if they’re provided

Labelled widgets updated to pass label parameter

Access #328 updated to take advantage of this

jarvisteach added a commit that referenced this issue Feb 17, 2018

Updates to fonts
Standardised fonts as:
_outputFont, _inputFont & _buttonFont

Still a couple to work out.

Added label to checkBox #377
Added font selectors to access #328
PagedWindow now uses global fonts

jarvisteach added a commit that referenced this issue Mar 1, 2018

jarvisteach added a commit that referenced this issue Mar 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment