From 618a6e52861a2489edc78125a6e086d8e87947de Mon Sep 17 00:00:00 2001 From: Patrick Vares Date: Sat, 2 May 2015 03:49:32 -0400 Subject: [PATCH 1/5] Allowed menu to 'stick' to the right when too many tabs exist. Tabs that cannot be displayed are automatically hidden. Removed old code which attempted to reduce tab size by hiding the text --- app/src/processing/app/EditorHeader.java | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/app/src/processing/app/EditorHeader.java b/app/src/processing/app/EditorHeader.java index 08fde7d0f..24fcc6800 100644 --- a/app/src/processing/app/EditorHeader.java +++ b/app/src/processing/app/EditorHeader.java @@ -273,7 +273,9 @@ public class EditorHeader extends JComponent { tab.textWidth = (int) font.getStringBounds(tab.text, g2.getFontRenderContext()).getWidth(); } - +/* TODO eliminated 279-302 because it doesn't really work to reduce the tab size (by much anyways) + * and makes it confusing to find the tab you want because the name is hidden + * // make sure everything can fit if (!placeTabs(MARGIN_WIDTH, tabMax, null)) { //System.arraycopy(tabs, 0, visitOrder, 0, tabs.length); @@ -297,14 +299,19 @@ public class EditorHeader extends JComponent { break; } } - } + }*/ // now actually draw the tabs - placeTabs(MARGIN_WIDTH, tabMax, g2); - - // draw the dropdown menu target - menuLeft = tabs[tabs.length - 1].right + TAB_BETWEEN; - menuRight = menuLeft + ARROW_TAB_WIDTH; + if(!placeTabs(MARGIN_WIDTH, tabMax - ARROW_TAB_WIDTH, g2)){ + // draw the dropdown menu target at the right of the window + menuRight = tabMax; + menuLeft = menuRight - ARROW_TAB_WIDTH; + } else { + // draw the dropdown menu target next to the tabs + menuLeft = tabs[tabs.length - 1].right + TAB_BETWEEN; + menuRight = menuLeft + ARROW_TAB_WIDTH; + } + g.setColor(tabColor[UNSELECTED]); drawTab(g, menuLeft, menuRight); // int arrowY = (getHeight() - TAB_HEIGHT - TAB_STRETCH) + (TAB_HEIGHT - ARROW_HEIGHT)/2; @@ -370,7 +377,7 @@ public class EditorHeader extends JComponent { // } tab.right = x; - if (g != null) { + if (g != null && tab.right < right) { g.setColor(tabColor[state]); drawTab(g, tab.left, tab.right); // path.lineTo(x - NOTCH, top); From 380a50d8ca969a8820e77b4ec7e84f8038a193f1 Mon Sep 17 00:00:00 2001 From: Akarshit Wal Date: Sun, 10 May 2015 01:38:09 +0530 Subject: [PATCH 2/5] Socks Proxy now supported if put in preference.txt --- app/src/processing/app/Preferences.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/processing/app/Preferences.java b/app/src/processing/app/Preferences.java index 13aac3280..d722d6a09 100644 --- a/app/src/processing/app/Preferences.java +++ b/app/src/processing/app/Preferences.java @@ -154,6 +154,13 @@ public class Preferences { System.setProperty("http.proxyHost", proxyHost); System.setProperty("http.proxyPort", proxyPort); } + String socksProxyHost = get("socksProxy.host"); + String socksProxyPort = get("socksProxy.port"); + if (socksProxyHost != null && socksProxyHost.length() != 0 && socksProxyPort != null + && socksProxyPort.length() != 0) { + System.setProperty("socksProxyHost", socksProxyHost); + System.setProperty("socksProxyPort", socksProxyPort); + } } From 765afa5024a46fd2e501ad298f799b4484b66f90 Mon Sep 17 00:00:00 2001 From: Akarshit Wal Date: Sun, 10 May 2015 01:46:43 +0530 Subject: [PATCH 3/5] Added socks support in the defaults file so that it is available in preference.txt --- build/shared/lib/defaults.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/shared/lib/defaults.txt b/build/shared/lib/defaults.txt index f52b4261d..5c58c69c7 100644 --- a/build/shared/lib/defaults.txt +++ b/build/shared/lib/defaults.txt @@ -327,6 +327,14 @@ run.present.stop.color = #cccccc proxy.host= proxy.port= +# SOCKS PROXY +# Set a proxy server for folks that require it. This will allow the update +# checker and the contrib manager to run properly in those environments. +#socksProxy.host=proxy.example.com +#socksProxy.port=9150 +socksProxy.host= +socksProxy.port= + # PDE X pdex.autoSave.autoSaveByDefault=true pdex.autoSave.autoSaveEnabled=false From 06afa9eee5dd0a6584d56b2ad020d84a80d48a05 Mon Sep 17 00:00:00 2001 From: Akarshit Wal Date: Sun, 10 May 2015 01:48:01 +0530 Subject: [PATCH 4/5] Added documentation --- app/src/processing/app/Preferences.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/processing/app/Preferences.java b/app/src/processing/app/Preferences.java index d722d6a09..54f19b873 100644 --- a/app/src/processing/app/Preferences.java +++ b/app/src/processing/app/Preferences.java @@ -154,6 +154,9 @@ public class Preferences { System.setProperty("http.proxyHost", proxyHost); System.setProperty("http.proxyPort", proxyPort); } + + // Set socks proxy for folks that require it. + // http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html String socksProxyHost = get("socksProxy.host"); String socksProxyPort = get("socksProxy.port"); if (socksProxyHost != null && socksProxyHost.length() != 0 && socksProxyPort != null From 9551e0d56bcd42089e92d943e011483d8f514e69 Mon Sep 17 00:00:00 2001 From: Akarshit Wal Date: Sun, 10 May 2015 01:48:53 +0530 Subject: [PATCH 5/5] Corrected identation --- app/src/processing/app/Preferences.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/processing/app/Preferences.java b/app/src/processing/app/Preferences.java index 54f19b873..87af338eb 100644 --- a/app/src/processing/app/Preferences.java +++ b/app/src/processing/app/Preferences.java @@ -154,13 +154,13 @@ public class Preferences { System.setProperty("http.proxyHost", proxyHost); System.setProperty("http.proxyPort", proxyPort); } - + // Set socks proxy for folks that require it. // http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html String socksProxyHost = get("socksProxy.host"); String socksProxyPort = get("socksProxy.port"); - if (socksProxyHost != null && socksProxyHost.length() != 0 && socksProxyPort != null - && socksProxyPort.length() != 0) { + if (socksProxyHost != null && socksProxyHost.length() != 0 && + socksProxyPort != null && socksProxyPort.length() != 0) { System.setProperty("socksProxyHost", socksProxyHost); System.setProperty("socksProxyPort", socksProxyPort); }