Changeset 1051 for trunk/src/org/expeditee
- Timestamp:
- 04/29/16 14:17:00 (8 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r977 r1051 53 53 import org.expeditee.items.widgets.WidgetCorner; 54 54 import org.expeditee.items.widgets.WidgetEdge; 55 import org.expeditee.settings.experimental.ExperimentalFeatures; 55 56 import org.expeditee.settings.templates.TemplateSettings; 56 57 import org.expeditee.stats.Formatter; … … 1196 1197 // space and return for the F keys that dont do anything in free space. 1197 1198 if (on == null) { 1199 1200 int mouse_x = FrameMouseActions.getX(), mouse_y = FrameMouseActions.getY(); 1201 1198 1202 switch (key) { 1199 1203 // These function keys still work in free space … … 1205 1209 case Save: 1206 1210 break; 1211 1207 1212 case SizeDown: 1208 zoomFrame(DisplayIO.getCurrentFrame(), 0.909090909f); 1209 DisplayIO.getCurrentFrame().refreshSize(); 1210 FrameKeyboardActions.Refresh(); 1211 return; 1213 zoomFrameIfEnabled(DisplayIO.getCurrentFrame(), 0.909090909f, mouse_x,mouse_y); 1212 1214 // if (isControlDown) { 1213 1215 // UserSettings.ScaleFactor.set(UserSettings.ScaleFactor.get() - … … 1216 1218 // return; 1217 1219 // } 1220 return; 1221 1218 1222 case SizeUp: 1219 zoomFrame(DisplayIO.getCurrentFrame(), 1.1f); 1220 DisplayIO.getCurrentFrame().refreshSize(); 1221 FrameKeyboardActions.Refresh(); 1223 zoomFrameIfEnabled(DisplayIO.getCurrentFrame(), 1.1f, mouse_x,mouse_y); 1224 // if (isControlDown) { 1225 // UserSettings.ScaleFactor.set(UserSettings.ScaleFactor.get() + 1226 // 0.05f); 1227 // Misc.repaint(); 1228 // return; 1229 // } 1222 1230 return; 1223 // if (isControlDown) { 1224 // UserSettings.ScaleFactor.set(UserSettings.ScaleFactor.get() + 1225 // 0.05f); 1226 // Misc.repaint(); 1227 // return; 1228 // } 1231 1229 1232 default: 1230 1233 MessageBay.displayMessageOnce(displayMessage); … … 1749 1752 } 1750 1753 1751 public static void zoomFrame(Frame frame, double scaleFactor) { 1752 1753 int x = FrameMouseActions.getX(), y = FrameMouseActions.getY(); 1754 protected static void zoomFrame(Frame frame, double scaleFactor, int x, int y) { 1754 1755 1755 1756 if (frame == null) { … … 1798 1799 } 1799 1800 1801 public static boolean zoomFrameIfEnabled(Frame frame, double scaleFactor, int mouse_x, int mouse_y) 1802 { 1803 boolean zoom_active = ExperimentalFeatures.FrameZoom.get(); 1804 1805 if (zoom_active) { 1806 1807 int x, y; 1808 if (ExperimentalFeatures.FrameZoomAroundCursor.get()) { 1809 x = mouse_x; 1810 y = mouse_y; 1811 } 1812 else { 1813 x = 0; 1814 y = 0; 1815 } 1816 1817 zoomFrame(DisplayIO.getCurrentFrame(), scaleFactor, x, y); 1818 DisplayIO.getCurrentFrame().refreshSize(); 1819 FrameKeyboardActions.Refresh(); 1820 } 1821 else { 1822 String frameZoomingDisabledMessage = "Frame Zooming currently disabled. " 1823 + "Access Settings->Experimental->FrameZoom and set to 'true' to enable this"; 1824 MessageBay.displayMessageOnce(frameZoomingDisabledMessage); 1825 } 1826 1827 return zoom_active; 1828 } 1829 1830 public static boolean zoomFrameTopLeftIfEnabled(Frame frame, double scaleFactor) 1831 { 1832 return zoomFrameIfEnabled(frame, scaleFactor, 0, 0); 1833 } 1834 1800 1835 /** 1801 1836 * Adjusts the size of the given Item, by the given amount. Note: The amount … … 1831 1866 // scale the entire frame 1832 1867 if (diff != 0) { 1833 zoomFrame(DisplayIO.getCurrentFrame(), diff > 0 ? 1.1 1834 : 0.909090909); 1835 DisplayIO.getCurrentFrame().refreshSize(); 1836 FrameKeyboardActions.Refresh(); 1868 double scaleFactor = diff > 0 ? 1.1 : 0.909090909; 1869 zoomFrameTopLeftIfEnabled(DisplayIO.getCurrentFrame(), scaleFactor); 1837 1870 } 1838 1871 // MessageBay.displayMessage("Can not resize the frame name"); -
trunk/src/org/expeditee/settings/experimental/ExperimentalFeatures.java
r919 r1051 25 25 public static final BooleanSetting AutoWrap = new BooleanSetting("Enable auto wrapping of text", false); 26 26 27 public static final BooleanSetting FrameZoom = new BooleanSetting("Enable zooming in and out of frame using F1/F2 or else shift with click-wheel", false); 28 29 public static final BooleanSetting FrameZoomAroundCursor = new BooleanSetting("If true, Frame Zooming uses the location of the mouse cursor as the central point to zoom in/out.", false); 30 27 31 public static final BooleanSetting MousePan = new BooleanSetting("Enable panning of the frame by shift-click and dragging the mouse", false); 28 32
Note:
See TracChangeset
for help on using the changeset viewer.