Fluid PR 313: update subtype menu to show "Normal" when deactivated.
Based on jdpalmer's pull request: If the subtype menu is disabled because there are no subtypes, the deactivated menu will still display the subtype of the last widget that had a subtype value. Clearing the menu when there are no subtypes fixes this minor inconsistency.
This commit is contained in:
parent
0a8b1845fe
commit
8e864bae21
@ -1726,21 +1726,30 @@ void value_cb(Fl_Value_Input* i, void* v) {
|
||||
Fl_Menu_Item *Fl_Widget_Type::subtypes() {return 0;}
|
||||
|
||||
void subtype_cb(Fl_Choice* i, void* v) {
|
||||
static Fl_Menu_Item empty_type_menu[] = {
|
||||
{"Normal",0,0,(void*)0},
|
||||
{0}};
|
||||
|
||||
if (v == LOAD) {
|
||||
Fl_Menu_Item* m = current_widget->subtypes();
|
||||
if (!m) {i->deactivate(); return;}
|
||||
i->menu(m);
|
||||
int j;
|
||||
for (j = 0;; j++) {
|
||||
if (!m[j].text) {j = 0; break;}
|
||||
if (current_widget->is_spinner()) {
|
||||
if (m[j].argument() == ((Fl_Spinner*)current_widget->o)->type()) break;
|
||||
} else {
|
||||
if (m[j].argument() == current_widget->o->type()) break;
|
||||
if (!m) {
|
||||
i->menu(empty_type_menu);
|
||||
i->value(0);
|
||||
i->deactivate();
|
||||
} else {
|
||||
i->menu(m);
|
||||
int j;
|
||||
for (j = 0;; j++) {
|
||||
if (!m[j].text) {j = 0; break;}
|
||||
if (current_widget->is_spinner()) {
|
||||
if (m[j].argument() == ((Fl_Spinner*)current_widget->o)->type()) break;
|
||||
} else {
|
||||
if (m[j].argument() == current_widget->o->type()) break;
|
||||
}
|
||||
}
|
||||
i->value(j);
|
||||
i->activate();
|
||||
}
|
||||
i->value(j);
|
||||
i->activate();
|
||||
i->redraw();
|
||||
} else {
|
||||
int mod = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user