[aseprite] 125/134: Add window resizing to options dialog.

Tobias Hansen thansen at moszumanska.debian.org
Sat Mar 14 17:10:17 UTC 2015


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit e21174d136c57bfaa01eb140101e50aa460cd8e2
Author: Tobias Hansen <tobias.han at gmx.de>
Date:   Sat Mar 14 15:20:27 2015 +0100

    Add window resizing to options dialog.
---
 debian/aseprite.1                              |   8 +-
 debian/changelog                               |   6 ++
 debian/patches/resizing_from_options_gui.patch | 130 +++++++++++++++++++++++++
 debian/patches/series                          |   1 +
 4 files changed, 143 insertions(+), 2 deletions(-)

diff --git a/debian/aseprite.1 b/debian/aseprite.1
index 97e8709..8f4b6b8 100644
--- a/debian/aseprite.1
+++ b/debian/aseprite.1
@@ -55,11 +55,15 @@ Display help and exit.
 .TP
 .B \-\-version
 Output version information and exit.
+.SH CONFIGURATION FILE
+.TP
+Asesprites configuration file is located at  ~/.config/aseprite/aseprite.ini 
 .SH RESIZING
 .TP
-Resizing of the window is unfortunately not possible with this version, because it requires a patched version of Allegro. Until the patch is in an official Allegro release and in Debian, one can set the size of the window in ~/.config/aseprite/aseprite.ini via the Width and Height settings in the section [GfxMode]. If these entries don't exist, start and close Aseprite once.
+Resizing of the window by dragging the window borders is unfortunately not possible with this version of Aseprite. The window size can be changed in the options dialog or by editing the configuration file.
 .PP
-To get a version of Aseprite with resizing capability, one can obtain and compile the code from https://github.com/aseprite/aseprite.
+To get a version of Aseprite with resizing capability, one can obtain and compile the code from https://github.com/aseprite/aseprite,
+which contains a patched version of the Allegro library.
 .SH SEE ALSO
 .TP
 .BR /usr/share/doc/aseprite/README.md.gz
diff --git a/debian/changelog b/debian/changelog
index 4855dd9..d283ead 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+aseprite (1.0.5+ds-3) UNRELEASED; urgency=medium
+
+  * Add patch to allow window resizing in options menu.
+
+ -- Tobias Hansen <thansen at debian.org>  Sat, 14 Mar 2015 14:12:23 +0100
+
 aseprite (1.0.5+ds-2) unstable; urgency=medium
 
   * debian/patches/disable-resize_image_tests.patch:
diff --git a/debian/patches/resizing_from_options_gui.patch b/debian/patches/resizing_from_options_gui.patch
new file mode 100644
index 0000000..d5952a9
--- /dev/null
+++ b/debian/patches/resizing_from_options_gui.patch
@@ -0,0 +1,130 @@
+--- a/data/widgets/options.xml
++++ b/data/widgets/options.xml
+@@ -17,10 +17,14 @@
+       <panel id="panel">
+         <vbox id="section_general">
+           <separator text="General" horizontal="true" />
+-          <hbox>
++          <grid columns="2">
++            <label text="Window Width:" />
++            <entry id="window_width" maxsize="4" />
++            <label text="Window Height:" />
++            <entry id="window_height" maxsize="4" />
+             <label text="Screen Scale:" />
+             <combobox id="screen_scale" />
+-          </hbox>
++          </grid>
+           <check text="Show timeline automatically" id="autotimeline" tooltip="Show the timeline automatically
when a new frame or layer is added." />
+           <separator horizontal="true" />
+           <link id="locate_file" text="Locate Configuration File" />
+--- a/src/app/commands/cmd_options.cpp
++++ b/src/app/commands/cmd_options.cpp
+@@ -80,6 +80,9 @@
+     if (m_settings->getShowSpriteEditorScrollbars())
+       showScrollbars()->setSelected(true);
+ 
++    windowWidth()->setTextf("%d", get_window_width());
++    windowHeight()->setTextf("%d", get_window_height());
++
+     // Checked background size
+     screenScale()->addItem("1:1");
+     screenScale()->addItem("2:1");
+@@ -163,11 +166,36 @@
+     m_settings->experimental()->setUseNativeCursor(nativeCursor()->isSelected());
+ 
+     int new_screen_scaling = screenScale()->getSelectedItemIndex()+1;
++
++    int window_width_value;
++    window_width_value = windowWidth()->getTextInt();
++    window_width_value = MID(280*new_screen_scaling, window_width_value, 9999);
++
++    int window_height_value;
++    window_height_value = windowHeight()->getTextInt();
++    window_height_value = MID(220*new_screen_scaling, window_height_value, 9999);
++
++    bool warn_restart = false;
++
++    if (window_width_value != get_window_width()) {
++      set_window_width(window_width_value);
++      warn_restart = true;
++    }
++
++    if (window_height_value != get_window_height()) {
++      set_window_height(window_height_value);
++      warn_restart = true;
++    }
++
+     if (new_screen_scaling != get_screen_scaling()) {
+       set_screen_scaling(new_screen_scaling);
++      warn_restart = true;
++    }
+ 
++    if (warn_restart) {
+       ui::Alert::show(PACKAGE
+-        "<<You must restart the program to see your changes to 'Screen Scale' setting."
++        "<<You must restart the program to see your changes to"
++        "<<'Window Width', 'Window Height' or 'Screen Scale' setting."
+         "||&OK");
+     }
+ 
+--- a/src/app/modules/gui.cpp
++++ b/src/app/modules/gui.cpp
+@@ -264,13 +264,41 @@
+   she::Display* display = Manager::getDefault()->getDisplay();
+   if (display) {
+     set_config_bool("GfxMode", "Maximized", display->isMaximized());
+-    set_config_int("GfxMode", "Width", display->originalWidth());
+-    set_config_int("GfxMode", "Height", display->originalHeight());
+     set_config_int("GfxMode", "Depth", bitmap_color_depth(screen));
+   }
+   set_config_int("GfxMode", "ScreenScale", screen_scaling);
+ }
+ 
++int get_window_width()
++{
++  int fallback = 0;
++  she::Display* display = Manager::getDefault()->getDisplay();
++  if (display) {
++    fallback = display->originalWidth();
++  }
++  return get_config_int("GfxMode", "Width", fallback);
++}
++
++void set_window_width(int width)
++{
++  set_config_int("GfxMode", "Width", width);
++}
++
++int get_window_height()
++{
++  int fallback = 0;
++  she::Display* display = Manager::getDefault()->getDisplay();
++  if (display) {
++    fallback = display->originalHeight();
++  }
++  return get_config_int("GfxMode", "Height", fallback);
++}
++
++void set_window_height(int height)
++{
++  set_config_int("GfxMode", "Height", height);
++}
++
+ int get_screen_scaling()
+ {
+   return screen_scaling;
+--- a/src/app/modules/gui.h
++++ b/src/app/modules/gui.h
+@@ -54,6 +54,12 @@
+   int init_module_gui();
+   void exit_module_gui();
+ 
++  int get_window_width();
++  void set_window_width(int width);
++
++  int get_window_height();
++  void set_window_height(int height);
++
+   int get_screen_scaling();
+   void set_screen_scaling(int scaling);
+ 
diff --git a/debian/patches/series b/debian/patches/series
index b75e18a..e8007c0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ libx11-underlinkage.patch
 fix-unittests.patch
 disable-file-and-gif-tests.patch
 disable-resize_image_tests.patch
+resizing_from_options_gui.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list