Merge pull request #10102 from vladest/tablet-ui-goto

Put current address to location instead of inputfield
This commit is contained in:
Seth Alves 2017-04-03 16:09:58 -07:00 committed by GitHub
commit fbf2014f04
3 changed files with 18 additions and 20 deletions

View file

@ -38,7 +38,7 @@ StackView {
root.currentItem.focus = true; root.currentItem.focus = true;
root.currentItem.forceActiveFocus(); root.currentItem.forceActiveFocus();
fillDestinations(); fillDestinations();
updateLocationText(); updateLocationText(false);
root.parentChanged.connect(center); root.parentChanged.connect(center);
center(); center();
} }
@ -63,8 +63,8 @@ StackView {
root.push(card); root.push(card);
return; return;
} }
addressLine.text = targetString; location.text = targetString;
toggleOrGo(true); toggleOrGo(true, targetString);
clearAddressLineTimer.start(); clearAddressLineTimer.start();
} }
@ -539,7 +539,11 @@ StackView {
} }
} }
function toggleOrGo(fromSuggestions) { function toggleOrGo(fromSuggestions, address) {
if (address !== undefined && address !== "") {
addressBarDialog.loadAddress(address, fromSuggestions)
}
if (addressLine.text !== "") { if (addressLine.text !== "") {
addressBarDialog.loadAddress(addressLine.text, fromSuggestions) addressBarDialog.loadAddress(addressLine.text, fromSuggestions)
} }

View file

@ -89,14 +89,17 @@ Preference {
if (categoryPreferences) { if (categoryPreferences) {
console.log("Category " + root.name + " with " + categoryPreferences.length + " preferences"); console.log("Category " + root.name + " with " + categoryPreferences.length + " preferences");
for (var j = 0; j < categoryPreferences.length; ++j) { for (var j = 0; j < categoryPreferences.length; ++j) {
buildPreference(categoryPreferences[j]); //provide component position within column
//lowest numbers on top
buildPreference(categoryPreferences[j], j);
} }
} }
} }
function buildPreference(preference) { function buildPreference(preference, itemNum) {
console.log("\tPreference type " + preference.type + " name " + preference.name) console.log("\tPreference type " + preference.type + " name " + preference.name)
var builder; var builder;
var zpos;
switch (preference.type) { switch (preference.type) {
case Preference.Editable: case Preference.Editable:
checkBoxCount = 0; checkBoxCount = 0;
@ -136,11 +139,14 @@ Preference {
case Preference.ComboBox: case Preference.ComboBox:
checkBoxCount = 0; checkBoxCount = 0;
builder = comboBoxBuilder; builder = comboBoxBuilder;
//make sure that combo boxes sitting higher will have higher z coordinate
//to be not overlapped when drop down is active
zpos = root.z + 1000 - itemNum
break; break;
}; };
if (builder) { if (builder) {
preferences.push(builder.createObject(contentContainer, { preference: preference, isFirstCheckBox: (checkBoxCount === 1) })); preferences.push(builder.createObject(contentContainer, { preference: preference, isFirstCheckBox: (checkBoxCount === 1) , z: zpos}));
} }
} }
} }

View file

@ -5786,22 +5786,10 @@ void Application::toggleRunningScriptsWidget() const {
} }
void Application::showScriptLogs() { void Application::showScriptLogs() {
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
auto scriptEngines = DependencyManager::get<ScriptEngines>(); auto scriptEngines = DependencyManager::get<ScriptEngines>();
QUrl defaultScriptsLoc = defaultScriptsLocation(); QUrl defaultScriptsLoc = defaultScriptsLocation();
defaultScriptsLoc.setPath(defaultScriptsLoc.path() + "developer/debugging/debugWindow.js"); defaultScriptsLoc.setPath(defaultScriptsLoc.path() + "developer/debugging/debugWindow.js");
scriptEngines->loadScript(defaultScriptsLoc.toString());
if (tablet->getToolbarMode()) {
scriptEngines->loadScript(defaultScriptsLoc.toString());
} else {
QQuickItem* tabletRoot = tablet->getTabletRoot();
if (!tabletRoot && !isHMDMode()) {
scriptEngines->loadScript(defaultScriptsLoc.toString());
} else {
tablet->pushOntoStack("../../hifi/dialogs/TabletDebugWindow.qml");
}
}
} }
void Application::showAssetServerWidget(QString filePath) { void Application::showAssetServerWidget(QString filePath) {