Fix T46998: Console zoom doesn't update scrollbars

This commit is contained in:
Campbell Barton 2015-12-18 16:02:31 +11:00
parent df6264f528
commit 4644f08685
Notes: blender-bot 2023-02-14 09:33:11 +01:00
Referenced by issue #46998, Cannot change console scrollback value, stuck at 300
4 changed files with 25 additions and 5 deletions

View File

@ -49,6 +49,8 @@ ConsoleLine *console_scrollback_add_str(struct SpaceConsole *sc, char *str, bool
ConsoleLine *console_history_verify(const struct bContext *C);
void console_textview_update_rect(SpaceConsole *sc, ARegion *ar);
void CONSOLE_OT_move(struct wmOperatorType *ot);
void CONSOLE_OT_delete(struct wmOperatorType *ot);
void CONSOLE_OT_insert(struct wmOperatorType *ot);

View File

@ -63,7 +63,7 @@ static void console_scroll_bottom(ARegion *ar)
v2d->cur.ymax = (float)v2d->winy;
}
static void console_textview_update_rect(SpaceConsole *sc, ARegion *ar)
void console_textview_update_rect(SpaceConsole *sc, ARegion *ar)
{
View2D *v2d = &ar->v2d;

View File

@ -372,17 +372,29 @@ static void console_header_region_draw(const bContext *C, ARegion *ar)
ED_region_header(C, ar);
}
static void console_main_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
static void console_main_region_listener(bScreen *UNUSED(sc), ScrArea *sa, ARegion *ar, wmNotifier *wmn)
{
// SpaceInfo *sinfo = sa->spacedata.first;
/* context changes */
switch (wmn->category) {
case NC_SPACE:
if (wmn->data == ND_SPACE_CONSOLE) { /* generic redraw request */
ED_region_tag_redraw(ar);
{
if (wmn->data == ND_SPACE_CONSOLE) {
if (wmn->action == NA_EDITED) {
if ((wmn->reference && sa) && (wmn->reference == sa->spacedata.first)) {
/* we've modified the geometry (font size), re-calculate rect */
console_textview_update_rect(wmn->reference, ar);
ED_region_tag_redraw(ar);
}
}
else {
/* generic redraw request */
ED_region_tag_redraw(ar);
}
}
break;
}
}
}

View File

@ -1353,6 +1353,12 @@ static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
return (BLI_listbase_is_empty(&sipo->ghostCurves) == false);
}
static void rna_SpaceConsole_rect_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
SpaceConsole *sc = ptr->data;
WM_main_add_notifier(NC_SPACE | ND_SPACE_CONSOLE | NA_EDITED, sc);
}
static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
ScrArea *sa = rna_area_from_space(ptr);
@ -3713,7 +3719,7 @@ static void rna_def_space_console(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "lheight");
RNA_def_property_range(prop, 8, 32);
RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CONSOLE, NULL);
RNA_def_property_update(prop, 0, "rna_SpaceConsole_rect_update");
prop = RNA_def_property(srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */