Changeset 1098:cd3cf67ef749


Ignore:
Timestamp:
08/11/23 14:46:33 (17 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

The main window can be made resizable (re #369).

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • locale/en/mlx.po

    r1097 r1098  
    16761676msgid "prefs_lang_hu_HU"
    16771677msgstr "Hungarian"
     1678
     1679msgid "prefs_mainWindowResizable"
     1680msgstr "_Resizable main window"
     1681
     1682msgid "prefs_mainWindowResizable_tooltip"
     1683msgstr ""
     1684"If checked, the main window can be resized. The default size of the "
     1685"main window is just enough to be able to show the interface elements "
     1686"properly, so resizing it is rarely necessary. However, there may be "
     1687"case when it is desirable. For example, if you have a screen that is "
     1688"just a bit larger than the window."
    16781689
    16791690msgid "prefs_hideMinimizedWindow"
  • locale/hu/mlx.po

    r1097 r1098  
    17171717msgid "prefs_lang_hu_HU"
    17181718msgstr "magyar"
     1719
     1720msgid "prefs_mainWindowResizable"
     1721msgstr "Át_méretezhető főablak"
     1722
     1723msgid "prefs_mainWindowResizable_tooltip"
     1724msgstr ""
     1725"Ha ezt kijelölöd, a főablakot át lehet méretezni. Az induláskor "
     1726"látható méret éppen megfelel ahhoz, hogy a grafikus felület elemeit "
     1727"megfelelően lássuk. Ezért az átméretezésre ritkán van szükség, de "
     1728"előfordulhatnak olyan esetek, amikor az hasznos. Például akkor, "
     1729"ha a képernyőnk mérete csak egy kicsivel nagyobb az ablakénál."
    17191730
    17201731msgid "prefs_hideMinimizedWindow"
  • src/mlx/config.py

    r1097 r1098  
    224224        self._clearBrowserCacheOnStart = False
    225225        self._language = ""
     226        self._mainWindowResizable = False
    226227        self._hideMinimizedWindow = True
    227228        self._quitOnClose = False
     
    335336
    336337    @property
     338    def mainWindowResizable(self):
     339        """Get whether a the main window should be resizable."""
     340        return self._mainWindowResizable
     341
     342    @mainWindowResizable.setter
     343    def mainWindowResizable(self, mainWindowResizable):
     344        """Set whether a minimized window should be hidden."""
     345        if mainWindowResizable!=self._mainWindowResizable:
     346            self._mainWindowResizable = mainWindowResizable
     347            self._modified = True
     348
     349    @property
    337350    def hideMinimizedWindow(self):
    338351        """Get whether a minimized window should be hidden."""
     
    773786        self._language = self._get(config, "general", "language", "")
    774787
     788        self._mainWindowResizable = self._getBoolean(config, "general",
     789                                                     "mainWindowResizable",
     790                                                     False)
    775791        self._hideMinimizedWindow = self._getBoolean(config, "general",
    776792                                                     "hideMinimizedWindow",
     
    884900        if self._language:
    885901            config.set("general", "language", self._language)
     902        config.set("general", "mainWindowResizable",
     903                   "yes" if self._mainWindowResizable else "no")
    886904        config.set("general", "hideMinimizedWindow",
    887905                   "yes" if self._hideMinimizedWindow else "no")
     
    10561074        print("  language:", self._language)
    10571075
     1076        print("  mainWindowResizable:", self._mainWindowResizable)
    10581077        print("  hideMinimizedWindow:", self._hideMinimizedWindow)
    10591078        print("  quitOnClose:", self._quitOnClose)
  • src/mlx/gui/gui.py

    r1097 r1098  
    118118        window.set_title(WINDOW_TITLE_BASE)
    119119        window.set_icon_from_file(os.path.join(iconDirectory, "logo.ico"))
    120         window.set_resizable(False)
     120        window.set_resizable(self.config.mainWindowResizable)
    121121        window.connect("delete-event", self.deleteMainWindow)
    122122        window.connect("window-state-event", self._handleMainWindowState)
     
    14321432        self._clearHotkeys()
    14331433        self._preferences.run(self.config)
     1434        self._mainWindow.set_resizable(self.config.mainWindowResizable)
    14341435        self._setupTimeSync()
    14351436        self._listenHotkeys()
  • src/mlx/gui/prefs.py

    r1094 r1098  
    231231
    232232        self._setLanguage(config.language)
     233        self._mainWindowResizable.set_active(config.mainWindowResizable)
    233234        self._hideMinimizedWindow.set_active(config.hideMinimizedWindow)
    234235        self._quitOnClose.set_active(config.quitOnClose)
     
    287288        """Setup the given config from the settings in the dialog."""
    288289        config.language = self._getLanguage()
     290        config.mainWindowResizable = self._mainWindowResizable.get_active()
    289291        config.hideMinimizedWindow = self._hideMinimizedWindow.get_active()
    290292        config.quitOnClose = self._quitOnClose.get_active()
     
    369371        self._warnedRestartNeeded = False
    370372
     373        self._mainWindowResizable = Gtk.CheckButton(xstr("prefs_mainWindowResizable"))
     374        self._mainWindowResizable.set_use_underline(True)
     375        self._mainWindowResizable.set_tooltip_text(xstr("prefs_mainWindowResizable_tooltip"))
     376        guiBox.pack_start(self._mainWindowResizable, False, False, 4)
     377
    371378        self._hideMinimizedWindow = Gtk.CheckButton(xstr("prefs_hideMinimizedWindow"))
    372379        self._hideMinimizedWindow.set_use_underline(True)
Note: See TracChangeset for help on using the changeset viewer.