Editor dynamic width redistribution method, device and equipment

By providing the editor dynamic width redistribution method in the application, the width redistribution problem during width adjustment of multiple editors is solved, ensuring that all editors' widths are not less than the minimum allowable width, improving the user experience.

CN119597170APending Publication Date: 2025-03-11WUHAN DAMENG DATABASE
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411618485.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In an application, when the width of multiple editors in the user interface is adjusted, the width redistribution problem between editors cannot be effectively handled, resulting in the width of some editors being less than the minimum acceptable width, affecting the user experience.

Method used

Provides a dynamic width redistribution method for editors, which dynamically adjusts the width of the operated editor and its adjacent editors based on the width adjustment amount, adjustment direction, and the editor's minimum allowable width, ensuring that all editors are not less than the minimum allowable width.

Benefits of technology

It realizes that when the user adjusts the editor width, dynamically reassigns the width of adjacent editors, ensuring that the width of all editors is reasonably allocated, avoiding situations that are less than the minimum allowable width, thereby improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597170A_ABST
    Figure CN119597170A_ABST
Patent Text Reader

Abstract

The invention discloses an editor dynamic width redistribution method, device and equipment, and relates to the technical field of user interface adjusting.The method comprises the steps that on the basis of the width adjustment amount, the adjustment direction and the minimum allowable width of an editor, according to the adjustment purpose, if the width is increased, the width of an operated editor and the width of an editor on the front side of the operated editor are adjusted; and if the width is reduced, adjusting the widths of the operated editor and the editor on the rear side of the operated editor, or adjusting the widths of the operated editor and the editor on the front side and the rear side of the operated editor. According to the invention, on the premise of ensuring that all editors are not smaller than the minimum allowable width, the reasonable distribution of the width is realized, and the user experience is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of user interface adjustment, and in particular to a method, device and equipment for dynamic width reallocation of an editor. Background Art

[0002] In an application, the user interface usually contains multiple resizable editors or windows. When the user adjusts the width of one editor based on usage requirements, the widths of other editors also need to be dynamically adjusted to ensure that the layout of the entire interface remains consistent.

[0003] Currently, the problem of width redistribution between editors cannot be effectively handled when adjusting the editor width. Especially when dealing with multiple editors, the width of some editors may be smaller than the minimum acceptable width, thus affecting the user experience. Summary of the invention

[0004] The present application provides a method, device and equipment for dynamic width reallocation of editors, which can achieve reasonable width allocation and effectively improve user experience under the premise of ensuring that all editors are not less than the minimum allowed width.

[0005] In a first aspect, an embodiment of the present application provides a method for dynamic width reallocation of an editor, the method comprising:

[0006] Based on the width adjustment amount, adjustment direction, and the minimum allowed width of the editor, and according to the purpose of the adjustment:

[0007] If the width is increased, the width of the operated editor and its front editor are adjusted;

[0008] If the width is reduced, the width of the operated editor and the editor behind it are adjusted, or the width of the operated editor and the editors before and after it are adjusted.

[0009] In combination with the first aspect, in one implementation,

[0010] If the width is increased, the width of the editor in front of the operated editor is reduced, and the width of the operated editor is increased;

[0011] If the width is reduced, the width of the operated editor or the width of the operated editor and the editor in front of the operated editor is reduced, and the width of the editor behind the operated editor is increased.

[0012] In combination with the first aspect, in one implementation,

[0013] The operated editor includes a first boundary and a second boundary;

[0014] The width increase includes driving the first boundary away from the second boundary to increase the editor width, and driving the second boundary away from the first boundary to increase the editor width;

[0015] The width reduction includes driving the first boundary close to the second boundary to reduce the editor width, and driving the second boundary close to the first boundary to reduce the editor width.

[0016] In combination with the first aspect, in one implementation, reducing the width of the editor in front of the operated editor and increasing the width of the operated editor specifically includes:

[0017] Along the adjustment direction, traverse to obtain the width of all editors in front of the operated editor, and determine the editor whose width can be reduced according to the minimum allowed width;

[0018] According to the adjustment direction and the minimum allowed width, the width of the editor can be reduced by reducing the width in sequence until the total width reduction amount is equal to the width adjustment amount, and the width of the operated editor is increased in real time according to the width reduction amount.

[0019] In combination with the first aspect, in one implementation, reducing the width in sequence according to the adjustment direction and the minimum allowed width may reduce the width of the editor until the total width reduction amount is equal to the width adjustment amount, and increasing the width of the operated editor in real time according to the width reduction amount, specifically includes:

[0020] According to the adjustment direction, the width of the reducible editor is obtained in turn, and the difference between the current width of the reducible editor and the minimum allowed width is calculated;

[0021] Determine whether the difference is not less than the current remaining width adjustment amount:

[0022] If so, the width of the editor can be reduced by reducing the current width based on the remaining width adjustment amount, and the width of the operated editor can be increased according to the width reduction amount of the editor that can be reduced by the current width;

[0023] If not, the width of the editor can be reduced by reducing the current width based on the current difference, the width of the editor being operated is increased according to the width reduction amount of the current width, and the remaining width adjustment amount is calculated again according to the width increase amount of the editor being operated.

[0024] In combination with the first aspect, in one implementation, reducing the width of the operated editor or the width of the operated editor and the editor in front of the operated editor, and increasing the width of the editor behind the operated editor, specifically includes:

[0025] Get the width of the operated editor, calculate the difference between the width of the operated editor and the minimum allowed width, and determine whether the difference is not less than the width adjustment amount:

[0026] If so, the width of the operated editor is reduced based on the width adjustment amount, and along the adjustment direction, the width of the adjacent editor behind the operated editor is increased based on the width reduction amount of the operated editor;

[0027] If not, the width of the operated editor is reduced based on the current difference, and along the adjustment direction, the width of the adjacent editor behind the operated editor is increased based on the width reduction of the operated editor to obtain the remaining width adjustment amount. At the same time, the widths of all editors in front of the operated editor are traversed to obtain the widths, and according to the minimum allowed width, the editor whose width can be reduced is determined. According to the adjustment direction and the minimum allowed width, the widths of the editors that can be reduced are reduced in turn until the total width reduction is equal to the remaining width adjustment amount, and the width of the adjacent editor behind the operated editor is increased in real time according to the width reduction.

[0028] In combination with the first aspect, in one implementation, the width of the editor may be reduced according to the adjustment direction and the minimum allowed width, until the total width reduction amount is equal to the remaining width adjustment amount, and the width of the adjacent editor behind the operated editor is increased in real time according to the width reduction amount, specifically including:

[0029] According to the adjustment direction, the width of the reducible editor is obtained in turn, and the difference between the current width of the reducible editor and the minimum allowed width is calculated;

[0030] Determine whether the difference is not less than the current remaining width adjustment amount:

[0031] If so, the width of the editor can be reduced by reducing the current width based on the remaining width adjustment amount, and the width of the adjacent editor behind the operated editor is increased according to the width reduction amount of the editor that can be reduced by the current width;

[0032] If not, the width of the editor can be reduced by reducing the current width based on the current difference, the width of the editor can be reduced by increasing the width of the adjacent editor behind the operated editor according to the amount of width reduction of the current width, and the remaining width adjustment amount can be calculated again according to the amount of width increase of the adjacent editor behind the operated editor.

[0033] In combination with the first aspect, in one implementation,

[0034] When the remaining width adjustment amount is not zero and the width of the shrinkable editor cannot be adjusted further, the adjustment ends.

[0035] In combination with the first aspect, in one implementation,

[0036] When the width increases, if there is no editor in front of the operated editor along the adjustment direction, the adjustment ends;

[0037] When the width is reduced, if there is no editor behind the operated editor along the adjustment direction, the adjustment is terminated.

[0038] In a second aspect, an embodiment of the present application provides an editor dynamic width reallocation device, the editor dynamic width reallocation device comprising:

[0039] A judgment module, which is used to drive the first execution module to work if the width is increased, and drive the second execution module to work if the width is reduced, based on the width adjustment amount, the adjustment direction, the minimum allowed width of the editor, and the adjustment purpose;

[0040] A first execution module, which is used to adjust the width of the operated editor and the editor in front of it;

[0041] The second execution module is used to adjust the width of the operated editor and the editor behind it, or to adjust the width of the operated editor and the editors before and after it.

[0042] In the third aspect, an embodiment of the present application provides an editor dynamic width reallocation device, which includes a processor, a memory, and an editor dynamic width reallocation program stored in the memory and executable by the processor, wherein when the editor dynamic width reallocation program is executed by the processor, the steps of the above-mentioned editor dynamic width reallocation method are implemented.

[0043] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:

[0044] When the user adjusts the width of the editor, the width of adjacent editors is dynamically reallocated. The original width of the editor, the width adjustment amount, and the minimum allowable width of a single editor are combined to achieve reasonable width allocation while ensuring that all editors are not less than the minimum allowable width, effectively improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 This is a flowchart of the dynamic width reallocation method of the editor of this application;

[0046] Figure 2 It is a flowchart of an embodiment when the width of the editor is increased;

[0047] Figure 3 This is a schematic diagram of an interface in a situation in an example of this application;

[0048] Figure 4 This is a schematic diagram of an interface in a situation in an example of this application;

[0049] Figure 5 This is a schematic diagram of an interface in a situation in an example of this application;

[0050] Figure 6 It is a flowchart of an embodiment when the width of the editor is reduced;

[0051] Figure 7 It is a flowchart of an embodiment when the width of the editor is reduced;

[0052] Figure 8 This is a schematic diagram of an interface in a situation in an example of this application;

[0053] Fig. 9 This is a schematic diagram of an interface in a situation in an example of this application;

[0054] Fig.10 This is a functional module diagram of the dynamic width reallocation device of the editor of this application;

[0055] Fig.11 Schematic diagram of the hardware structure of the dynamic width reallocation device of the editor for this application. DETAILED DESCRIPTION

[0056] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0057] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0058] In a first aspect, an embodiment of the present application provides a method for dynamic width reallocation of an editor, for adjusting the width of an editor in a user interface that simultaneously displays multiple editors.

[0059] In one embodiment, referring to Figure 1 , Figure 1 This is a flowchart of the dynamic width reallocation method of the application editor. Figure 1 As shown, the editor dynamic width redistribution method includes:

[0060] S1: Based on the width adjustment amount, adjustment direction, and the minimum allowed width of the editor, if the width is increased, go to S2, and if the width is reduced, go to S3 according to the adjustment purpose; the minimum allowed width of the editor is the minimum allowed width of a single editor, which is used to indicate the minimum width that can be reduced. When the width of an editor is equal to the minimum allowed width, the width of the editor cannot be reduced any further;

[0061] S2: adjusting the width of the operated editor and its front editor; specifically, reducing the width of the front editor of the operated editor and increasing the width of the operated editor;

[0062] S3: Adjust the width of the operated editor and the editor behind it, or adjust the width of the operated editor and the editors before and after it; specifically, reduce the width of the operated editor or the width of the operated editor and the editor in front of it, and increase the width of the editor behind it.

[0063] Specifically, according to the width adjustment purpose, if the width is increased, based on the width adjustment amount, adjustment direction, and minimum allowed width, the width of the editor in front of the operated editor is reduced, and the width of the operated editor is increased; if the width is reduced, based on the width adjustment amount, adjustment direction, and minimum allowed width, the width of the operated editor or the width of the operated editor and the editor in front of the operated editor is reduced, and the width of the editor behind the operated editor is increased. It should be noted that no matter whether the width of the editor is increased or decreased, it remains in close contact with the adjacent editor.

[0064] It should be noted that the operated editor includes a first boundary and a second boundary. Specifically, the first boundary and the second boundary are arranged relative to each other; increasing the width includes driving the first boundary away from the second boundary to increase the editor width, and driving the second boundary away from the first boundary to increase the editor width; reducing the width includes driving the first boundary close to the second boundary to reduce the editor width, and driving the second boundary close to the first boundary to reduce the editor width.

[0065] In actual applications, when an interface contains multiple editors, the multiple editors may be arranged horizontally or vertically.

[0066] When the editors are arranged horizontally, the first boundary refers to the left side of the editor, and the second boundary refers to the right side of the editor. When the mouse drags the left side of the operated editor to the left, the width is increased and the adjustment direction is from right to left. The editor on the left of the operated editor is the front editor, and the editor on the right of the operated editor is the back editor. When the mouse drags the right side of the operated editor to the right, the width is increased and the adjustment direction is from left to right. The editor on the right of the operated editor is the front editor, and the editor on the left of the operated editor is the back editor. When the mouse drags the right side of the operated editor to the left, the width is reduced and the adjustment direction is from right to left. The editor on the left of the operated editor is the front editor, and the editor on the right of the operated editor is the back editor. When the mouse drags the left side of the operated editor to the right, the width is reduced and the adjustment direction is from left to right. The editor on the right of the operated editor is the front editor, and the editor on the left of the operated editor is the back editor.

[0067] Correspondingly, when the editors are arranged vertically, the relevant definitions are similar to those when the editors are arranged horizontally. For example, when the editors are arranged vertically, the first boundary refers to the lower side of the editor, and the second boundary refers to the upper side of the editor. When the mouse drags the lower side of the operated editor upward, the adjustment direction is from bottom to top for the purpose of width reduction. The editor above the operated editor refers to the front editor, and the editor below the operated editor refers to the back editor. The width adjustment execution logic when the editors are arranged vertically can also be implemented based on the editor dynamic width reallocation method described in this application, which will not be repeated in this article.

[0068] Furthermore, in one embodiment, reducing the width of the editor in front of the operated editor and increasing the width of the operated editor specifically includes:

[0069] S201: traverse along the adjustment direction to obtain the widths of all editors in front of the operated editor, and determine the editor whose width can be reduced according to the minimum allowed width;

[0070] Specifically, for all editors in front of the operated editor, if the width of the current editor is not less than the minimum allowed width, the current editor is determined to be an editor whose width can be reduced, ensuring that even if the width of the editor is reduced, its final width will not be less than the minimum allowed width, thereby finding all editors in front of the operated editor whose width can be reduced;

[0071] S202: According to the adjustment direction and the minimum allowed width, the width of the editor can be reduced by reducing the width in sequence until the total width reduction amount is equal to the width adjustment amount, and the width of the operated editor is increased in real time according to the width reduction amount.

[0072] Specifically, dragging the left side of the operated editor to the left to increase the width of the operated editor will expand the width of the operated editor and dynamically compress the width of the editor on the left, but the compressed width will only be added to the operated editor; correspondingly, dragging the right side of the operated editor to the right to increase the width of the operated editor will expand the width of the operated editor and dynamically compress the width of the editor on the right, but the compressed width will only be added to the operated editor.

[0073] In actual applications, the minimum allowed width may be set to be the same for all editors, or a specific minimum allowed width may be set for a single editor.

[0074] Furthermore, in one embodiment, according to the adjustment direction and the minimum allowed width, the width of the editor can be reduced by reducing the width in sequence until the total width reduction amount is equal to the width adjustment amount, and the width of the operated editor is increased in real time according to the width reduction amount, specifically including:

[0075] S2021: according to the adjustment direction, the width-reducible editors are obtained in turn, and the difference between the current width-reducible editor width and the minimum allowed width is calculated;

[0076] S2022: Determine whether the difference is not less than the current remaining width adjustment amount:

[0077] If so, the width of the editor can be reduced by reducing the current width based on the remaining width adjustment amount, and the width of the operated editor can be increased according to the width reduction amount of the editor that can be reduced by the current width;

[0078] If not, the width of the editor can be reduced by reducing the current width based on the current difference, the width of the editor being operated is increased according to the width reduction amount of the current width, and the remaining width adjustment amount is calculated again according to the width increase amount of the editor being operated.

[0079] See also Figure 2 As shown, for the above steps S2021 and S2022, the specific execution process is:

[0080] A1: Calculate the current width to reduce the difference between the editor width and the minimum allowed width, and go to A2;

[0081] A2: Determine whether the difference is not less than the current remaining width adjustment amount. If so, go to A3; if not, go to A4.

[0082] A3: The width of the editor can be reduced by reducing the current width based on the remaining width adjustment amount, and the width of the operated editor can be increased according to the amount by which the width of the editor can be reduced;

[0083] A4: Based on the current difference, the width of the editor can be reduced by reducing the current width, and the width of the operated editor is increased according to the width reduction amount of the editor that can be reduced by the current width. The remaining width adjustment amount is calculated again according to the width increase amount of the operated editor, and then go to A5;

[0084] A5: Get the next width according to the adjustment direction to shrink the editor and go to A1.

[0085] The above process is explained below with reference to an example.

[0086] See also Figure 3 As shown, it is assumed that the interface contains a total of 4 horizontally arranged editors. From left to right, the width of the first editor is 400, the width of the second editor is 350, the width of the third editor is 300, and the width of the fourth editor is 250. The minimum allowed width of a single editor is 200. The third editor is the operated editor. Drag the left edge of the operated editor to the left to increase the width of the operated editor.

[0087] If the width adjustment amount is 100, since the widths of the first and second editors are both greater than the minimum allowed width of 200, the first and second editors are both editors whose widths can be reduced. According to the adjustment direction, the second editor is first obtained, and the difference between its width and the minimum allowed width is calculated to be 150. The difference 150 is greater than the current remaining width adjustment amount of 100, so the width of the second editor is reduced by 100, and the width of the third editor is increased by 100, resulting in the following: Figure 4 In the interface shown, the width of the first editor is 400, the width of the second editor is 250, the width of the third editor is 400, and the width of the fourth editor is 250.

[0088] If the width adjustment amount is 200, since the widths of the first and second editors are both greater than the minimum allowed width of 200, the first and second editors are both editors whose widths can be reduced. According to the adjustment direction, first obtain the second editor, and calculate the difference between it and the minimum allowed width as 150. The difference of 150 is less than the current remaining width adjustment of 200, so the width of the second editor is reduced by 150, and the width of the third editor is increased by 150. At this time, the width of the third editor has increased by 150, so the remaining width adjustment amount calculated at this time is 50. Then obtain the first editor, and calculate the difference between it and the minimum allowed width as 200. The difference of 200 is greater than the current remaining width adjustment of 50, so the width of the first editor is reduced by 50, and the width of the third editor is increased by 50. At this time, the remaining width adjustment amount calculated is 0, so the adjustment is completed, as shown below: Figure 5In the interface shown, the width of the first editor is 350, the width of the second editor is 200, the width of the third editor is 500, and the width of the fourth editor is 250.

[0089] Furthermore, in one embodiment, reducing the width of the operated editor or the width of the operated editor and the editor in front of the operated editor, and increasing the width of the editor behind the operated editor, specifically includes:

[0090] Get the width of the operated editor, calculate the difference between the width of the operated editor and the minimum allowed width, and determine whether the difference is not less than the width adjustment amount:

[0091] If so, the width of the operated editor is reduced based on the width adjustment amount, and along the adjustment direction, the width of the adjacent editor behind the operated editor is increased based on the width reduction amount of the operated editor;

[0092] If not, the width of the operated editor is reduced based on the current difference, and along the adjustment direction, the width of the adjacent editor behind the operated editor is increased based on the width reduction of the operated editor to obtain the remaining width adjustment amount. At the same time, the widths of all editors in front of the operated editor are traversed to obtain the widths, and according to the minimum allowed width, the editor whose width can be reduced is determined. According to the adjustment direction and the minimum allowed width, the widths of the editors that can be reduced are reduced in turn until the total width reduction is equal to the remaining width adjustment amount, and the width of the adjacent editor behind the operated editor is increased in real time according to the width reduction.

[0093] Specifically, dragging the right side of the operated editor to the left to reduce the width of the operated editor will compress the width of the operated editor and may compress the width of the editor on the left, but the compressed width will be added to the first editor on the right side of the operated editor; correspondingly, dragging the left side of the operated editor to the right to reduce the width of the operated editor will compress the width of the operated editor and may compress the width of the editor on the right, but the compressed width will be added to the first editor on the left side of the operated editor.

[0094] See also Figure 6 As shown, the above execution process is specifically described.

[0095] B1: Get the width of the operated editor, calculate the difference between the width of the operated editor and the minimum allowed width, and go to B2;

[0096] B2: Determine whether the difference is not less than the width adjustment amount. If so, go to B3; if not, go to B4.

[0097] B3: The width of the operated editor is reduced based on the width adjustment amount, and along the adjustment direction, the width of the adjacent editor behind the operated editor is increased based on the width reduction amount of the operated editor;

[0098] B4: Reduce the width of the operated editor based on the current difference, and increase the width of the adjacent editor behind the operated editor based on the width reduction of the operated editor along the adjustment direction to obtain the remaining width adjustment amount, and go to B5;

[0099] B5: Traverse to obtain the width of all editors in front of the operated editor, and determine the editor whose width can be reduced according to the minimum allowed width. Reduce the width of the editor in turn according to the adjustment direction and the minimum allowed width until the total width reduction is equal to the remaining width adjustment amount, and increase the width of the adjacent editor behind the operated editor in real time according to the width reduction amount.

[0100] Furthermore, in one embodiment, according to the adjustment direction and the minimum allowed width, the width of the editor can be reduced by reducing the width in sequence until the total width reduction amount is equal to the remaining width adjustment amount, and the width of the adjacent editor behind the operated editor is increased in real time according to the width reduction amount, specifically including:

[0101] S3021: Obtain the width-reducible editors in turn according to the adjustment direction, and calculate the difference between the current width of the width-reducible editor and the minimum allowed width;

[0102] S3022: Determine whether the difference is not less than the current remaining width adjustment amount:

[0103] If so, the width of the editor can be reduced by reducing the current width based on the remaining width adjustment amount, and the width of the adjacent editor behind the operated editor is increased according to the width reduction amount of the editor that can be reduced by the current width;

[0104] If not, the width of the editor can be reduced by reducing the current width based on the current difference, the width of the editor can be reduced by increasing the width of the adjacent editor behind the operated editor according to the amount of width reduction of the current width, and the remaining width adjustment amount can be calculated again according to the amount of width increase of the adjacent editor behind the operated editor.

[0105] See also Figure 7 As shown, for steps S3021 and S3022, the specific execution process is:

[0106] C1: Calculate the current width to reduce the difference between the editor width and the minimum allowed width, and go to C2;

[0107] C2: Determine whether the difference is not less than the current remaining width adjustment amount. If so, go to C3; if not, go to C4;

[0108] C3: The width of the editor can be reduced by reducing the current width based on the remaining width adjustment amount, and the width of the adjacent editor behind the operated editor can be increased according to the width reduction amount of the current width;

[0109] C4: Based on the current difference, the width of the editor can be reduced by reducing the current width, and the width of the adjacent editor behind the operated editor is increased according to the width reduction amount of the editor behind the operated editor. The remaining width adjustment amount is calculated again according to the width increase amount of the adjacent editor behind the operated editor, and then go to C5;

[0110] C5: Get the next width according to the adjustment direction to reduce the editor width and go to C1.

[0111] The above process is explained below with reference to an example.

[0112] See also Figure 3 As shown, it is assumed that the interface contains a total of 4 horizontally arranged editors. From left to right, the width of the first editor is 400, the width of the second editor is 350, the width of the third editor is 300, and the width of the fourth editor is 250. The minimum allowed width of a single editor is 200. The third editor is the operated editor. Drag the right edge of the operated editor to the left to reduce the width of the operated editor.

[0113] If the width adjustment amount is 100, according to the adjustment direction, first get the third editor, calculate the difference between its width and the minimum allowed width as 100, the difference 100 is equal to the current remaining width adjustment amount 100, then reduce the width of the third editor by 100, and increase the width of the fourth editor by 100, and get the following Figure 8 In the interface shown, the width of the first editor is 400, the width of the second editor is 350, the width of the third editor is 200, and the width of the fourth editor is 350.

[0114] If the width adjustment amount is 200, first get the third editor according to the adjustment direction, and calculate the difference between it and the minimum allowed width as 100. The difference of 100 is less than the current remaining width adjustment of 200, then reduce the width of the third editor by 100, and increase the width of the fourth editor by 100. At this time, the increase in the width of the fourth editor is 100, and the remaining width adjustment amount is 100. Since the widths of the first and second editors are both greater than 200, the first and second editors are editors whose widths can be reduced. Therefore, continue to get the second editor according to the adjustment direction, and calculate the difference between it and the minimum allowed width as 150. The difference of 150 is greater than the current remaining width adjustment of 100, then reduce the width of the second editor by 100, and increase the width of the fourth editor by 100. At this time, the width of the fourth editor has increased by 200, and the remaining width adjustment amount calculated at this time is 0, so the adjustment is completed, as shown below: Fig. 9 In the interface shown, the width of the first editor is 400, the width of the second editor is 250, the width of the third editor is 200, and the width of the fourth editor is 450.

[0115] It should be noted that in some special cases, when the remaining width adjustment amount is not zero and the width can be reduced and the editor width cannot be adjusted further, the adjustment ends. For example, see Figure 3 As shown, it is assumed that the interface contains a total of 4 horizontally arranged editors. From left to right, the width of the first editor is 400, the width of the second editor is 350, the width of the third editor is 300, and the width of the fourth editor is 250. The minimum allowed width of a single editor is 200, of which the third editor is the operated editor. Drag the right side of the operated editor to the left to reduce the width of the operated editor. If the width of the first editor is reduced to 200, the remaining width adjustment amount is calculated to be 100, and there is no editor on the left side of the first editor whose width can be reduced, so the adjustment ends at this time.

[0116] Furthermore, when the width increases, if there is no editor in front of the operated editor along the adjustment direction, the adjustment is terminated; when the width decreases, if there is no editor behind the operated editor along the adjustment direction, the adjustment is terminated.

[0117] For example, for Figure 3 In the interface shown, the first editor is defined as the operated editor. If the left side of the operated editor is dragged to the left to increase the width of the operated editor, the adjustment operation will not be performed because there is no editor in front of the operated editor. If the left side of the operated editor is dragged to the right to decrease the width of the operated editor, the adjustment operation will not be performed because there is no editor behind the operated editor.

[0118] The editor dynamic width reallocation method of the embodiment of the present application dynamically reallocates the widths of adjacent editors when the user adjusts the editor width, and combines the original width of the editor, the width adjustment amount, and the minimum allowed width of a single editor to achieve reasonable width allocation while ensuring that all editors are not less than the minimum allowed width, thereby effectively improving the user experience.

[0119] In a second aspect, an embodiment of the present application also provides an editor dynamic width reallocation device.

[0120] In one embodiment, referring to Fig.10 , Fig.10 This is a functional module diagram of the dynamic width reallocation device of the editor of this application. Fig.10 As shown, the editor dynamic width reallocation device includes: a judgment module, a first execution module, and a second execution module.

[0121] The judgment module is used to drive the first execution module to work if the width is increased, and to drive the second execution module to work if the width is reduced based on the width adjustment amount, adjustment direction, and the minimum allowed width of the editor, and according to the adjustment purpose; the first execution module is used to adjust the width of the operated editor and the editor in front of it; the second execution module is used to adjust the width of the operated editor and the editor in back of it, or to adjust the width of the operated editor and the editors in front and behind it.

[0122] In a third aspect, an embodiment of the present application provides an editor dynamic width reallocation device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.

[0123] Reference Fig.11 , Fig.11 The hardware structure diagram of the editor dynamic width reallocation device involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the editor dynamic width reallocation device may include a processor, a memory, a communication interface, and a communication bus.

[0124] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.

[0125] The communication interface includes input / output (I / O) interface, physical interface and logical interface, etc., which are used to realize the interconnection of devices inside the editor dynamic width reallocation device, and the interface used to realize the interconnection of the editor dynamic width reallocation device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.

[0126] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0127] The processor may be a general-purpose processor, which may call the editor dynamic width reallocation program stored in the memory and execute the editor dynamic width reallocation method provided by the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the editor dynamic width reallocation program is called may refer to the various embodiments of the editor dynamic width reallocation method of the present application, which will not be repeated here.

[0128] Those skilled in the art will understand that Fig.11 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0129] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.

[0130] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.

[0131] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0132] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0133] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0134] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for dynamic width redistribution of an editor, characterized in that: The editor dynamic width reallocation method comprises: Based on the width adjustment amount, adjustment direction, and the minimum allowed width of the editor, and according to the purpose of the adjustment: If the width is increased, the width of the operated editor and its front editor are adjusted; If the width is reduced, the width of the operated editor and the editor behind it are adjusted, or the width of the operated editor and the editors before and after it are adjusted.

2. The editor dynamic width reallocation method according to claim 1, characterized in that: If the width is increased, the width of the editor in front of the operated editor is reduced, and the width of the operated editor is increased; If the width is reduced, the width of the operated editor or the width of the operated editor and the editor in front of the operated editor is reduced, and the width of the editor behind the operated editor is increased.

3. The editor dynamic width reallocation method as claimed in claim 2, characterized in that: The operated editor includes a first boundary and a second boundary; The width increase includes driving the first boundary away from the second boundary to increase the editor width, and driving the second boundary away from the first boundary to increase the editor width; The width reduction includes driving the first boundary close to the second boundary to reduce the editor width, and driving the second boundary close to the first boundary to reduce the editor width.

4. The editor dynamic width reallocation method as claimed in claim 2, characterized in that: The reducing the width of the editor in front of the operated editor and increasing the width of the operated editor specifically includes: Along the adjustment direction, traverse to obtain the width of all editors in front of the operated editor, and determine the editor whose width can be reduced according to the minimum allowed width; According to the adjustment direction and the minimum allowed width, the width of the editor can be reduced by reducing the width in sequence until the total width reduction amount is equal to the width adjustment amount, and the width of the operated editor is increased in real time according to the width reduction amount.

5. The editor dynamic width reallocation method as claimed in claim 4, characterized in that: The width of the editor can be reduced by reducing the width in sequence according to the adjustment direction and the minimum allowed width until the total width reduction amount is equal to the width adjustment amount, and the width of the operated editor is increased in real time according to the width reduction amount, specifically including: According to the adjustment direction, the width of the reducible editor is obtained in turn, and the difference between the current width of the reducible editor and the minimum allowed width is calculated; Determine whether the difference is not less than the current remaining width adjustment amount: If so, the width of the editor can be reduced by reducing the current width based on the remaining width adjustment amount, and the width of the operated editor can be increased according to the width reduction amount of the editor that can be reduced by the current width; If not, the width of the editor can be reduced by reducing the current width based on the current difference, the width of the editor being operated is increased according to the width reduction amount of the current width, and the remaining width adjustment amount is calculated again according to the width increase amount of the editor being operated.

6. The editor dynamic width reallocation method as claimed in claim 2, characterized in that: The reducing the width of the operated editor or the width of the operated editor and the editor in front of the operated editor, and increasing the width of the editor behind the operated editor, specifically includes: Get the width of the operated editor, calculate the difference between the width of the operated editor and the minimum allowed width, and determine whether the difference is not less than the width adjustment amount: If so, the width of the operated editor is reduced based on the width adjustment amount, and along the adjustment direction, the width of the adjacent editor behind the operated editor is increased based on the width reduction amount of the operated editor; If not, the width of the operated editor is reduced based on the current difference, and along the adjustment direction, the width of the adjacent editor behind the operated editor is increased based on the width reduction of the operated editor to obtain the remaining width adjustment amount. At the same time, the widths of all editors in front of the operated editor are traversed to obtain the widths, and according to the minimum allowed width, the editor whose width can be reduced is determined. According to the adjustment direction and the minimum allowed width, the widths of the editors that can be reduced are reduced in turn until the total width reduction is equal to the remaining width adjustment amount, and the width of the adjacent editor behind the operated editor is increased in real time according to the width reduction.

7. The editor dynamic width reallocation method as claimed in claim 6, characterized in that: The width of the editor can be reduced by reducing the width in sequence according to the adjustment direction and the minimum allowed width until the total width reduction amount is equal to the remaining width adjustment amount, and the width of the adjacent editor behind the operated editor is increased in real time according to the width reduction amount, specifically including: According to the adjustment direction, the width of the reducible editor is obtained in turn, and the difference between the current width of the reducible editor and the minimum allowed width is calculated; Determine whether the difference is not less than the current remaining width adjustment amount: If so, the width of the editor can be reduced by reducing the current width based on the remaining width adjustment amount, and the width of the adjacent editor behind the operated editor is increased according to the width reduction amount of the editor that can be reduced by the current width; If not, the width of the editor can be reduced by reducing the current width based on the current difference, the width of the editor can be reduced by increasing the width of the adjacent editor behind the operated editor according to the amount of width reduction of the current width, and the remaining width adjustment amount can be calculated again according to the amount of width increase of the adjacent editor behind the operated editor.

8. The editor dynamic width reallocation method according to claim 5 or 7, characterized in that: When the remaining width adjustment amount is not zero and the width of the shrinkable editor cannot be adjusted further, the adjustment ends.

9. The editor dynamic width reallocation method as claimed in claim 2, characterized in that: When the width increases, if there is no editor in front of the operated editor along the adjustment direction, the adjustment ends; When the width is reduced, if there is no editor behind the operated editor along the adjustment direction, the adjustment is terminated.

10. An editor dynamic width reallocation device, characterized in that: The editor dynamic width reallocation device comprises: A judgment module, which is used to drive the first execution module to work if the width is increased, and drive the second execution module to work if the width is reduced, based on the width adjustment amount, the adjustment direction, the minimum allowed width of the editor, and the adjustment purpose; A first execution module, which is used to adjust the width of the operated editor and the editor in front of it; The second execution module is used to adjust the width of the operated editor and the editor behind it, or to adjust the width of the operated editor and the editors before and after it.

11. An editor dynamic width reallocation device, characterized in that: The editor dynamic width reallocation device includes a processor, a memory, and an editor dynamic width reallocation program stored in the memory and executable by the processor, wherein when the editor dynamic width reallocation program is executed by the processor, the steps of the editor dynamic width reallocation method as described in any one of claims 1 to 9 are implemented.

Citation Information

Cited By

  • Page structure layout rapid adjustment method and device, equipment and storage medium

    CN120406783A