Kitchen Sink

  • 36 Replies
  • 792 Views
Kitchen Sink
« on: 10 June 2019, 15:00:11 »
Would a kitchen sink example would be useful for future tgui users?

*

texus

  • *****
  • 1463
    • View Profile
    • Texus's Blog
Re: Kitchen Sink
« Reply #1 on: 10 June 2019, 15:03:29 »
I think it would definitely be useful.

Re: Kitchen Sink
« Reply #2 on: 10 June 2019, 15:09:35 »
Ok, i 've already started.

Re: Kitchen Sink
« Reply #3 on: 11 June 2019, 11:08:01 »
During adding "labels" in kitchen sink i was thinking how awesome would be if a "texture" feature exist! There isn't a "texture" for labels, correct?

*

texus

  • *****
  • 1463
    • View Profile
    • Texus's Blog
Re: Kitchen Sink
« Reply #4 on: 11 June 2019, 17:53:23 »
How would a texture of a label be displayed? Do you mean a BackgroundTexture property as alternative to the BackgroundColor?

Re: Kitchen Sink
« Reply #5 on: 11 June 2019, 19:43:09 »
Yes exactly, a background texture instead of background color.


Labels tab finished
« Last Edit: 11 June 2019, 20:28:10 by billarhos »

Re: Kitchen Sink
« Reply #6 on: 12 June 2019, 08:39:39 »
Labels + buttons ready

Windows platform executable
http://www.mediafire.com/file/6hr1gs6ecevpdv4/KitchenSink.rar/file

*

texus

  • *****
  • 1463
    • View Profile
    • Texus's Blog
Re: Kitchen Sink
« Reply #7 on: 12 June 2019, 19:46:51 »
I've added a TextureBackground property to the label renderer.

I really like how it looks, but I got some minor feedbacks on some parts.
- On the "Labels" tab it also says "Canvas", is that something you are still going to add there or am I missing something?
- Labels can do more than demonstrated. Maybe at the bottom you can have a label with a lot of text in it, so that it gets a vertical scrollbar. There is also the possibility for a Label to have word-wrap by setting a width without setting a maximum height (via setMaximumTextWidth), although showing the version with a scrollbar is probably more important to showcase.
- Maybe "Double click me" would be better than "Click me double"?
- The arrow buttons in the Buttons tab don't seem to have a separate hover and down states. They might look better if the entire rectangle become a little more white when hovered and only gets the black arrow when in down state.
- Maybe pressing the Button0 again should switch it back to the original state? After you clicked on them you can see what they did but it is too late to actually pay attention to it. It is arguable that it serves mostly so you can see how to do it in the code, but then you might as well not switch the text at all.
- The "Button theme2", "Button theme3" and "Button theme4" buttons are probably named that way because they are "themed" button number X, but when I saw the names I expected them to have a different theme, just like the labels. If the name was e.g. "Button 2 with theme" then it would be more clear that the number is about the button, not the theme.
- Maybe swap the location of the "Open keyboard" button and the radio buttons? It is probably just because I wasn't paying attention, but I was clicking around and suddenly I got a different keyboard as before and I didn't immediately realize that it was because of the radio buttons next to it.
- To me the "CappsOff" and "CappsOn" seem inverted. It works either way as it depends on how you interpret it: does it show the current state vs the state you are going to. I personally expected it to be the latter instead of the former.

Overall I still love how it looks and what it is becoming. Keep up the good work!

Re: Kitchen Sink
« Reply #8 on: 12 June 2019, 20:11:45 »
Quote
I've added a TextureBackground property to the label renderer.
Great!

Quote
On the "Labels" tab it also says "Canvas", is that something you are still going to add there or am I missing something?
The bottom line is painted via "tgui::Canvas"; On top i give a clue to user of what i demonstrate in each tab!
I agree with all other stuff you said but when i ll finish the code i ll make the png texture theme, so all will make sense.

I believe tomorrow i will finish the code.

Re: Kitchen Sink
« Reply #9 on: 13 June 2019, 12:00:07 »
Code: [Select]
pClickableWidget = tgui::ClickableWidget::create();
pClickableWidget->setPosition(50, 620);
        pClickableWidget->setSize(250, 100);

  tgui::ToolTip::setTimeToDisplay(sf::milliseconds(1000));
tgui::ToolTip::setDistanceToMouse({ 4, 8 });

pLabelToolTip = tgui::Label::create("ClickableWidget is here!");
pLabelToolTip->setPosition(pClickableWidget->getPosition());
pClickableWidget->setToolTip(pLabelToolTip);


the above code show the tooltip all the time. Missing something?

*

texus

  • *****
  • 1463
    • View Profile
    • Texus's Blog
Re: Kitchen Sink
« Reply #10 on: 13 June 2019, 17:59:28 »
Are you calling something like "gui.add(pLabelToolTip)" somewhere by any chance?
pLabelToolTip->setPosition shouldn't be called like that. The position will be relative to the mouse.

Re: Kitchen Sink
« Reply #11 on: 13 June 2019, 18:15:49 »
Quote
Are you calling something like "gui.add(pLabelToolTip)" somewhere by any chance?
YES, i remove it. Now never shows.
Commenting "pLabelToolTip->setPosition()" also didn't help.

Should i give tooltip widget position?

*

texus

  • *****
  • 1463
    • View Profile
    • Texus's Blog
Re: Kitchen Sink
« Reply #12 on: 13 June 2019, 18:22:21 »
If you added it to the widget with setTooltip then it should show up on the bottom right of your mouse cursor (4 pixels to the right and 8 pixels down in this case) if put the mouse on top of the widget and don't move it for more than a second. You shouldn't have to call pLabelToolTip->setPosition at all, unless you want to add an extra offset to the tooltip which other widgets don't have.

Is there nothing in front of the clickable widget?

Re: Kitchen Sink
« Reply #13 on: 13 June 2019, 18:48:23 »
Ha, i thought that "setTimeToDisplay" has to do with how long the tooltip would shown. Sorry.! I stay still for 1000 mscs and it appeared.

I think i am down with the code. i 'll move forward to finish gui.png!

*

texus

  • *****
  • 1463
    • View Profile
    • Texus's Blog
Re: Kitchen Sink
« Reply #14 on: 13 June 2019, 18:56:38 »
Now that you mention it, it does sound like that. Maybe I should rename it to setTimeBeforeDisplay or setTimeBeforeShowing?