mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1001129 - Autoselect an item in icon grid inputs. r=mfinkle
This commit is contained in:
parent
46ee08f495
commit
be6e94a4ab
@ -38,7 +38,7 @@ public class IconGridInput extends PromptInput implements OnItemClickListener {
|
||||
private static int mColumnWidth = -1; // The maximum width of columns
|
||||
private static int mMaxColumns = -1; // The maximum number of columns to show
|
||||
private static int mIconSize = -1; // Size of icons in the grid
|
||||
private int mSelected = -1; // Current selection
|
||||
private int mSelected = 0; // Current selection, default to first item
|
||||
private JSONArray mArray;
|
||||
|
||||
public IconGridInput(JSONObject obj) {
|
||||
@ -76,7 +76,6 @@ public class IconGridInput extends PromptInput implements OnItemClickListener {
|
||||
items.add(item);
|
||||
if (item.selected) {
|
||||
mSelected = i;
|
||||
view.setSelection(i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,6 +84,8 @@ public class IconGridInput extends PromptInput implements OnItemClickListener {
|
||||
|
||||
mAdapter = new IconGridAdapter(context, -1, items);
|
||||
view.setAdapter(mAdapter);
|
||||
view.setItemChecked(mSelected, true);
|
||||
|
||||
mView = view;
|
||||
return mView;
|
||||
}
|
||||
|
@ -134,6 +134,7 @@ HelperAppLauncherDialog.prototype = {
|
||||
name: bundle.GetStringFromName("helperapps.saveToDisk"),
|
||||
packageName: "org.mozilla.gecko.Download",
|
||||
iconUri: "drawable://icon",
|
||||
selected: true, // Default to download for all files
|
||||
launch: function() {
|
||||
// Reset the preferredAction here.
|
||||
aLauncher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.saveToDisk;
|
||||
|
Loading…
Reference in New Issue
Block a user