summaryrefslogtreecommitdiffstats
path: root/devtools/client/responsive/actions/ui.js
blob: b2f05cb7c9cbf0739600a359a20473727a06a02e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

const {
  CHANGE_DISPLAY_PIXEL_RATIO,
  CHANGE_USER_AGENT,
  TOGGLE_LEFT_ALIGNMENT,
  TOGGLE_RELOAD_ON_TOUCH_SIMULATION,
  TOGGLE_RELOAD_ON_USER_AGENT,
  TOGGLE_TOUCH_SIMULATION,
  TOGGLE_USER_AGENT_INPUT,
} = require("resource://devtools/client/responsive/actions/index.js");

module.exports = {
  /**
   * The pixel ratio of the display has changed. This may be triggered by the user
   * when changing the monitor resolution, or when the window is dragged to a different
   * display with a different pixel ratio.
   */
  changeDisplayPixelRatio(displayPixelRatio) {
    return {
      type: CHANGE_DISPLAY_PIXEL_RATIO,
      displayPixelRatio,
    };
  },

  changeUserAgent(userAgent) {
    return {
      type: CHANGE_USER_AGENT,
      userAgent,
    };
  },

  toggleLeftAlignment(enabled) {
    return {
      type: TOGGLE_LEFT_ALIGNMENT,
      enabled,
    };
  },

  toggleReloadOnTouchSimulation(enabled) {
    return {
      type: TOGGLE_RELOAD_ON_TOUCH_SIMULATION,
      enabled,
    };
  },

  toggleReloadOnUserAgent(enabled) {
    return {
      type: TOGGLE_RELOAD_ON_USER_AGENT,
      enabled,
    };
  },

  toggleTouchSimulation(enabled) {
    return {
      type: TOGGLE_TOUCH_SIMULATION,
      enabled,
    };
  },

  toggleUserAgentInput(enabled) {
    return {
      type: TOGGLE_USER_AGENT_INPUT,
      enabled,
    };
  },
};