Skip to content

Commit

Permalink
Fix titlebar annotations for customized reference viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
ejeschke committed May 10, 2024
1 parent f2fb134 commit 7e61d97
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ginga/qtw/CanvasRenderQt.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, renderer, viewer, surface):

# special scaling for Qt text drawing to normalize it relative
# to other backends
self._font_scale_factor = 1.4
self._font_scale_factor = 1.0

def get_line(self, color, alpha=1.0, linewidth=1, linestyle='solid'):
line = super().get_line(color, alpha=alpha, linewidth=linewidth,
Expand Down
12 changes: 7 additions & 5 deletions ginga/rv/Control.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def __init__(self, logger, thread_pool, module_manager, preferences,
# Create general preferences
self.prefs = preferences
settings = self.prefs.create_category('general')
settings.add_defaults(title="Ginga",
settings.add_defaults(appname='ginga',
title="Ginga",
fixedFont=None,
serifFont=None,
sansFont=None,
Expand Down Expand Up @@ -116,6 +117,7 @@ def __init__(self, logger, thread_pool, module_manager, preferences,
self.cur_channel = None
self.wscount = 0
self.statustask = None
self.appname = settings.get('appname', 'ginga')

# Load bindings preferences
bindprefs = self.prefs.create_category('bindings')
Expand Down Expand Up @@ -197,7 +199,7 @@ def get_backend_timer(self):
return self.make_timer()

def stop(self):
self.logger.info("shutting down Ginga...")
self.logger.info(f"shutting down {self.appname}...")
self.timer_factory.quit()
self.ev_quit.set()
self.logger.debug("should be exiting now")
Expand Down Expand Up @@ -453,7 +455,7 @@ def help_text(self, name, text, text_kind='plain', trim_pfx=0):
def help(self, text=None, text_kind='url'):
if text_kind == 'url':
if text is None:
# get top URL of external Ginga RTD docs
# get top URL of external RTD docs
text = download_doc.get_online_docs_url(plugin=None)
self.show_help_url(text)
else:
Expand Down Expand Up @@ -1346,7 +1348,7 @@ def add_channel(self, chname, workspace=None,
num_images=None, settings=None,
settings_template=None,
settings_share=None, share_keylist=None):
"""Create a new Ginga channel.
"""Create a new channel.
Parameters
----------
Expand Down Expand Up @@ -1825,7 +1827,7 @@ def make_viewer(self, vinfo, channel):
####################################################

def set_titlebar(self, text):
self.w.root.set_title("Ginga: %s" % text)
self.w.root.set_title("{}: {}".format(self.appname.capitalize(), text))

def build_viewpane(self, settings, rgbmap=None, size=(1, 1)):
# instantiate bindings loaded with users preferences
Expand Down
3 changes: 2 additions & 1 deletion ginga/rv/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ def main(self, options, args):
# Set up preferences
prefs = Settings.Preferences(basefolder=self.basedir, logger=logger)
settings = prefs.create_category('general')
settings.set_defaults(title=self.appname.capitalize(),
settings.set_defaults(appname=self.appname,
title=self.appname.capitalize(),
useMatplotlibColormaps=False,
widgetSet='choose',
WCSpkg='choose', FITSpkg='choose',
Expand Down

0 comments on commit 7e61d97

Please sign in to comment.