-
Notifications
You must be signed in to change notification settings - Fork 14
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
added possibility to switch off the delay - fixed window behaviour #39
base: master
Are you sure you want to change the base?
Conversation
clicking left mouse button on a tip shows the next tip clicking right mouse button on the tip shows the previous tip added the option to set delay = 0 (though that doesn't work with replicants yet)
@@ -37,7 +37,7 @@ enum | |||
MainWindow::MainWindow() | |||
: | |||
BWindow(BRect(100, 100, 740, 190), B_TRANSLATE_SYSTEM_NAME("Tipster"), | |||
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_V_RESIZABLE | |||
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the | B_NOT_V_RESIZABLE? Now the window can be resized in a way that shows a large grey area.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well... it's not really smaller, it's narrower but has to be taller. You can always have the whole tip visible by making the window wider. We try to keep the tips as short as possible to fit into a reasonably sized window (or replicated view). IMO keeping the window height equal to the icon button height looks much nicer.
|
||
BDragger* dragger = new BDragger(this); | ||
|
||
BLayoutBuilder::Group<>(this, B_HORIZONTAL, 0) | ||
.SetInsets(-2, -2, 0, -2) | ||
.Add(fIcon) | ||
.SetInsets(1, 1, 1, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those insets were on purpose to avoid the smal spacing around the icon and have it flush with the view borders. It should be kept as is, IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe that's a question to discuss about :-) For me this way looks more as a button as when it's completely attached
fRunner = new BMessageRunner(this, message, fDelay); | ||
if (fDelay > 0) { | ||
// if delay is set to Off (0), don't send a runner message | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This empty line isn't needed.
More importantly: if you go from some delay to "Off", the previous BMessageRunner is still running and keeps changing tips after the the former delay. So you still have to delete the BMessageRunner if delay == 0. Maybe something like this:
if (fRunner != NULL) {
delete fRunner;
fRunner = NULL;
}
if (fDelay > 0) {
// if delay is set to Off (0), don't send a runner message
BMessage message(UPDATE_TIP);
fRunner = new BMessageRunner(this, message, fDelay);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's a big help for me! Didn't know how to solve it ...
return ref; | ||
else if (getLocalTipsFile(ref, BString(language, | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding style says "else if" on one line.
BMessage message(UPDATE_TIP); | ||
|
||
fMessenger->SendMessage(&message); | ||
if (buttons == 1) //left mouse button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Insted of a comment, you can use the constants B_PRIMARY_MOUSE_BUTTON and B_SECONDARY_MOUSE_BUTTON.
any update on this? |
Working on it (again) - thanks for the comment :-) |
I cannot comment with a Haiku browser without having to "resolve" that comment thread. Which I can then no longer expand to read... |
should fix #36
should fix #37
fixes #32
though, resizing behaviour is still not perfect